diff --git a/cli.py b/cli.py new file mode 100644 index 00000000..cb4ef34c --- /dev/null +++ b/cli.py @@ -0,0 +1,19 @@ +""" stand alone command line script for use with pyinstaller + + To build this into an executable: + - install pyinstaller: + python3 -m pip install pyinstaller + - then use build_cli_exe.sh to run pyinstaller or execute the following command: + pyinstaller --onefile --hidden-import="pkg_resources.py2_warn" --name osxphotos --add-data osxphotos/templates/xmp_sidecar.mako:osxphotos/templates cli.py + + Resulting executable will be in "dist/osxphotos" + + Note: This is *not* the cli that "python3 -m pip install osxphotos" or "python setup.py install" would install; + it's merely a wrapper around __main__.py to allow pyinstaller to work + +""" + +from osxphotos.__main__ import cli + +if __name__ == "__main__": + cli() diff --git a/make_cli_exe.sh b/make_cli_exe.sh new file mode 100755 index 00000000..1438c0d0 --- /dev/null +++ b/make_cli_exe.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# This will build an stand-alone executable called 'osxphotos' in your ./dist directory +# using pyinstaller +# If you need to install pyinstaller: +# python3 -m pip install --upgrade pyinstaller + +pyinstaller --onefile --hidden-import="pkg_resources.py2_warn" --name osxphotos --add-data osxphotos/templates/xmp_sidecar.mako:osxphotos/templates cli.py \ No newline at end of file