bbelderbos / emojisearcher

No more google search, copy emojis to the clipboard.
MIT License
20 stars 1 forks source link

Add console script (entry point) in pyproject.toml (and module rename) #6

Open bbelderbos opened 1 year ago

bbelderbos commented 1 year ago

I currently use emojisearcher with the following shell alias:

# .zshrc
function emo {
    (cd $HOME/code/emojisearcher && source venv/bin/activate && python -m emojisearcher.script "$@")
}

# this works:
$ emo tada rocket snake smile bicep
Copied 🎉 🚀 🐍 😄 💪 to clipboard

It would be nice to provide a shortcut in the pyproject.toml:

Way to do it: https://stackoverflow.com/a/73066937

[project.scripts]
my-client = "my_package.my_module:main_cli"

So that would be something like:

[project.scripts]
my-client = "emojisearcher.script:main"

Maybe also nice to rename script.py to a more meaningful name in this same effort ...