diff --git a/.gitignore b/.gitignore index 46e0eab..2e5ee6c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,5 @@ __pycache__ /cocoa/autogen /locale -/run.py /cocoa/*/Info.plist /cocoa/*/build diff --git a/Makefile b/Makefile index 378bde1..df7fd0e 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,7 @@ env : | $(submodules_target) reqs build: ./env/bin/python build.py -.PHONY : reqs build all \ No newline at end of file +run: + ./env/bin/python run.py + +.PHONY : reqs build run all \ No newline at end of file diff --git a/build.py b/build.py index 1c25988..1b4637e 100644 --- a/build.py +++ b/build.py @@ -152,10 +152,6 @@ def build_cocoa(dev): resources = [image_path, 'cocoa/dsa_pub.pem', 'build/dg_cocoa.py', 'build/help'] app.copy_resources(*resources, use_symlinks=dev) app.copy_frameworks('build/Python') - print("Creating the run.py file") - tmpl = open('cocoa/run_template.py', 'rt').read() - run_contents = tmpl.replace('{{app_path}}', app.dest) - open('run.py', 'wt').write(run_contents) def build_help(): print("Generating Help") diff --git a/dupeguru b/dupeguru index f51f94e..245ed0d 160000 --- a/dupeguru +++ b/dupeguru @@ -1 +1 @@ -Subproject commit f51f94e03db3c36468bc40200679f098a0346a62 +Subproject commit 245ed0ddecd0fad4a8e8dab3be07d319c14b1514 diff --git a/package.py b/package.py new file mode 100644 index 0000000..d730b2a --- /dev/null +++ b/package.py @@ -0,0 +1,26 @@ +# Copyright 2017 Virgil Dupras +# +# This software is licensed under the "GPLv3" License as described in the "LICENSE" file, +# which should be included with this package. The terms are also available at +# http://www.gnu.org/licenses/gpl-3.0.html + +from argparse import ArgumentParser + +from hscommon.build import setup_package_argparser, package_cocoa_app_in_dmg + +def parse_args(): + parser = ArgumentParser() + setup_package_argparser(parser) + return parser.parse_args() + +def package_cocoa(args): + app_path = 'build/dupeGuru.app' + package_cocoa_app_in_dmg(app_path, '.', args) + +def main(): + args = parse_args() + print("Packaging dupeGuru with UI cocoa") + package_cocoa(args) + +if __name__ == '__main__': + main() diff --git a/cocoa/run_template.py b/run.py similarity index 67% rename from cocoa/run_template.py rename to run.py index 840e710..6e52930 100644 --- a/cocoa/run_template.py +++ b/run.py @@ -4,7 +4,7 @@ import sys import os def main(): - return os.system('open "{{app_path}}"') + return os.system('open "build/dupeGuru.app"') if __name__ == '__main__': sys.exit(main()) \ No newline at end of file