diff --git a/README.md b/README.md index ad04406..90cf0ca 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,5 @@ If you are looking for downloads go here: http://addons.getnightingale.com/ You can use the script make.py to generate xpi files like this: ```shell -python make.py -```` - -(add-on_folder without trailing slash) +./make.py +``` diff --git a/make.py b/make.py index ee2a349..2d8160d 100755 --- a/make.py +++ b/make.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import os import sys from zipfile import ZipFile @@ -9,7 +11,7 @@ install = parse(os.path.join(sys.argv[1], "install.rdf")) element = install.getElementsByTagName("em:version")[0] version = element.firstChild.data - xpiName = sys.argv[1] + "-" + version + ".xpi" + xpiName = sys.argv[1].rstrip("/") + "-" + version + ".xpi" xpi = ZipFile(xpiName, "w") os.chdir(sys.argv[1]) for root, dirs, files in os.walk("."): @@ -18,7 +20,7 @@ xpi.write(path, path, 8) xpi.close() os.chdir("..") - if os.path.exists(xpiName): + if os.path.exists(os.path.basename(xpiName)): print(xpiName + " successfully written.") else: sys.exit(xpiName + " could not be written.")