From d72cdc92725d70f429024951a2b490a040d977b6 Mon Sep 17 00:00:00 2001 From: Thomas Lake Date: Sun, 9 Sep 2018 18:30:52 +0100 Subject: [PATCH 1/2] Optionally limit sync to bootstrapped apps tilda_tools sync # Syncs everything, as before tilda_tools --bootstrapped-apps sync # Removes any apps not marked as bootstrapped in their main.py Fixes #123 --- .development/tilda_tools.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.development/tilda_tools.py b/.development/tilda_tools.py index 15f1fa9..6b7ea8f 100755 --- a/.development/tilda_tools.py +++ b/.development/tilda_tools.py @@ -61,6 +61,7 @@ def main(): cmd_parser.add_argument('-b', '--baudrate', default=115200, help='the baud rate of the serial device') cmd_parser.add_argument('-v', '--verbose', action='store_true', help='adds more output') cmd_parser.add_argument('--skip-wifi', action='store_true', help='does not sync wifi.json') + cmd_parser.add_argument('--bootstrapped-apps', action='store_true', help='[Sync] only bootstrapped apps by default') cmd_parser.add_argument('--print_resources', action='store_true', help='prints resources in json') cmd_parser.add_argument('--boot', help='defines which app to boot into after reboot') cmd_parser.add_argument('--run', help='like run, but after a sync') @@ -120,6 +121,13 @@ def main(): pyboard_util.hard_reset(args) if command == "sync": + if args.bootstrapped_apps: + for k,val in list(resources.items()): + if val.get("type", None) == "app" and not val.get("bootstrapped", False): + if args.verbose: + print("Removing app '{0}' from sync list".format(k)) + del resources[k] + if args.clean: sync.clean(args) paths = args.paths if len(args.paths) else None From dbb8515fb82ef8793fc3d764b483f74877d30156 Mon Sep 17 00:00:00 2001 From: Thomas Lake Date: Sun, 9 Sep 2018 18:45:11 +0100 Subject: [PATCH 2/2] Don't remove paths explicitly specified on command line --- .development/tilda_tools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.development/tilda_tools.py b/.development/tilda_tools.py index 6b7ea8f..44424f3 100755 --- a/.development/tilda_tools.py +++ b/.development/tilda_tools.py @@ -121,16 +121,17 @@ def main(): pyboard_util.hard_reset(args) if command == "sync": + paths = args.paths if len(args.paths) else None if args.bootstrapped_apps: for k,val in list(resources.items()): - if val.get("type", None) == "app" and not val.get("bootstrapped", False): - if args.verbose: - print("Removing app '{0}' from sync list".format(k)) - del resources[k] + if val.get("type", None) == "app": + if not k in paths and not val.get("bootstrapped", False): + if args.verbose: + print("Removing app '{0}' from sync list".format(k)) + del resources[k] if args.clean: sync.clean(args) - paths = args.paths if len(args.paths) else None synced_resources = sync.sync(args, paths, resources, args.verbose, args.skip_wifi) if (command in ["reset", "sync"]) or run_tests: