From 8e8cfa6f53b95fb9a7f7a430fb7bda77be56a6bd Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 10 Oct 2019 23:22:29 +1100 Subject: [PATCH] tools/make-frozen.py: Allow to run with no directory passed in. In which case it will just emit empty frozen C definitions. --- tools/make-frozen.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/make-frozen.py b/tools/make-frozen.py index 1051b520e4..8809fd0c8e 100755 --- a/tools/make-frozen.py +++ b/tools/make-frozen.py @@ -27,14 +27,15 @@ def module_name(f): modules = [] -root = sys.argv[1].rstrip("/") -root_len = len(root) +if len(sys.argv) > 1: + root = sys.argv[1].rstrip("/") + root_len = len(root) -for dirpath, dirnames, filenames in os.walk(root): - for f in filenames: - fullpath = dirpath + "/" + f - st = os.stat(fullpath) - modules.append((fullpath[root_len + 1:], st)) + for dirpath, dirnames, filenames in os.walk(root): + for f in filenames: + fullpath = dirpath + "/" + f + st = os.stat(fullpath) + modules.append((fullpath[root_len + 1:], st)) print("#include ") print("const char mp_frozen_str_names[] = {")