From 5c4834fff803a5239419010950865fea4865010a Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Mon, 8 Sep 2014 11:59:20 +0200 Subject: [PATCH] Name files by separating the version with _. Parse off the version number correctly during package.json generation. --- BUGS.org | 5 +++-- Makefile | 4 ++-- rules/node-webkit.mk | 4 ++-- tools/generate-nw | 13 +++---------- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/BUGS.org b/BUGS.org index dcde463..08497da 100644 --- a/BUGS.org +++ b/BUGS.org @@ -1,5 +1,5 @@ * Next Version -** Upgrade node-webkit wrapper to 0.10.4. +** DONE Upgrade node-webkit wrapper to 0.10.4. This moves the Windows version of Chromium several steps forward, and fixes the stall that prevented the 0.10.x series from working properly on Windows before. @@ -7,7 +7,8 @@ Actually, they still do in most browsers, but as position: sticky support rolls out, they will work correctly. ** DONE Include DLLs necessary for broader Windows support +** DONE Fix version number in OS X About dialog + * Pending -** TODO Fix version number in OS X About dialog ** TODO Detect WebGL failure on Windows and offer DX redistributable diff --git a/Makefile b/Makefile index 3753998..0649138 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ include rules/pngcrush.mk APPLICATION := pwl6 DISTDIR := build/dist VERSION := $(call git-describe) -DISTROOT := $(DISTDIR)/$(APPLICATION)-$(VERSION) +DISTROOT := $(DISTDIR)/$(APPLICATION)_$(VERSION) FIND_FILES := -type f ! -name '.*' FIND_JS := -type f -name '*.js' @@ -96,6 +96,6 @@ $(DISTROOT).bare.zip: | .git %.nw: %.bare.zip tools/generate-nw $(RM) -r $@ $@.tmp $(UNZIP) -d $@.tmp $< - tools/generate-nw $@.tmp + tools/generate-nw $@.tmp `echo $(*F) | sed -E 's/.+_[^0-9]+//'` cd $@.tmp && $(ZIP) -r ../$(@F) . $(RM) -r $@.tmp diff --git a/rules/node-webkit.mk b/rules/node-webkit.mk index 79d8178..dd46e17 100644 --- a/rules/node-webkit.mk +++ b/rules/node-webkit.mk @@ -55,7 +55,7 @@ define node-webkit-package-linux mkdir -p $(@:.tar.gz=) mv $(@D)/$(notdir $(2:.tar.gz=)) $(@:.tar.gz=)/nw cp -a $1 $(@:.tar.gz=)/nw/package.nw - cp -a tools/nw-linux-wrapper $(@:.tar.gz=)/`echo $(notdir $1) | sed -E 's/-[^-]+$$//'` + cp -a tools/nw-linux-wrapper $(@:.tar.gz=)/`echo $(notdir $1) | sed -E 's/_.+//'` $(RM) $(@:.tar.gz=)/nw/nwsnapshot mv $(@:.tar.gz=)/nw/credits.html $(@:.tar.gz=)/nw/node-webkit\ credits.html tar -czf $@ -C $(@D) $(@F:.tar.gz=) @@ -84,7 +84,7 @@ define node-webkit-package-win mv $(@:.zip=)/credits.html $(@:.zip=)/node-webkit\ credits.html cp -a $< $(@:.zip=)/package.nw cp -a $(node-webkit-directx) $(@:.zip=) - mv $(@:.zip=)/nw.exe $(@:.zip=)/`echo $(notdir $1) | sed -E 's/-[^-]+$$/.exe/'` + mv $(@:.zip=)/nw.exe $(@:.zip=)/`echo $(notdir $1) | sed -E 's/_.+/.exe/'` cd $(@D) && $(ZIP) -r $(@F) $(@F:.zip=) $(RM) -r $(@:.zip=) endef diff --git a/tools/generate-nw b/tools/generate-nw index a3cd564..61959f2 100755 --- a/tools/generate-nw +++ b/tools/generate-nw @@ -16,7 +16,7 @@ def is_html(filename): def attr(name): return "data-" + name + """=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?""" -def main(appdir): +def main(appdir, version=None): if not os.path.isdir(appdir): raise StandardError("input (%r) is not a directory" % appdir) indexes = [] @@ -36,7 +36,7 @@ def main(appdir): package = { "main": indexes[0], "name": name, - "version": "0.0.0", + "version": version or "0.0.0", "window": { "show": False, "toolbar": False, @@ -79,11 +79,4 @@ def main(appdir): if __name__ == "__main__": import sys - try: - appdir = sys.argv[1] - except IndexError: - raise SystemExit("Usage: %s appdir" %( - sys.argv[0])) - else: - main(appdir) - + main(*sys.argv[1:]) -- 2.30.2