diff options
Diffstat (limited to 'mkconfig.py')
-rw-r--r-- | mkconfig.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mkconfig.py b/mkconfig.py index 47cc0ee..ad04413 100644 --- a/mkconfig.py +++ b/mkconfig.py @@ -10,16 +10,13 @@ if os.path.isfile("settings.json"): settings = json.load(f) # get all userscripts -paths = glob.glob(os.path.join('.', '**', '*.js'), recursive=True) -paths = [ path.removesuffix(".js") for path in paths ] +paths = glob.glob(os.path.join('.', '**', '*.user.js'), recursive=True) # zipp with zipfile.ZipFile("violentmonkey.zip", 'w', zipfile.ZIP_DEFLATED) as zipf: for path in paths: - arcname = os.path.basename(path) + ".user.js" # basename and add .user.js suffix - path += ".js" - zipf.write(path, arcname=arcname) + zipf.write(path, arcname=os.path.basename(path)) zipf.writestr("violentmonkey", json.dumps({ - "scripts": { os.path.basename(path): {} for path in paths }, + "scripts": { os.path.basename(path).removesuffix(".user.js"): {} for path in paths }, "settings": settings, })) |