diff options
| -rw-r--r-- | scripts/build.py | 4 | ||||
| -rwxr-xr-x | scripts/copyright.py | 4 | ||||
| -rw-r--r-- | scripts/make_release.py | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/scripts/build.py b/scripts/build.py index 4e86d16b..0fa0bd2b 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -6,9 +6,9 @@ if sys.version_info[0] == 2: elif sys.version_info[0] == 3: import urllib.request url_lib = urllib.request -match = re.search("(.*?)/[^/]*?$", sys.argv[0]) +match = re.search('(.*)/', sys.argv[0]) if match != None: - os.chdir(os.getcwd() + "/" + match.group(1)) + os.chdir(match.group(1)) url_bam = "http://github.com/matricks/bam/zipball/master" url_teeworlds = "http://github.com/oy/teeworlds/zipball/master" diff --git a/scripts/copyright.py b/scripts/copyright.py index 29e1bbfe..fade0b13 100755 --- a/scripts/copyright.py +++ b/scripts/copyright.py @@ -1,7 +1,7 @@ import os, re, sys -match = re.search("(.*?)/[^/]*?$", sys.argv[0]) +match = re.search('(.*)/', sys.argv[0]) if match != None: - os.chdir(os.getcwd() + "/" + match.group(1)) + os.chdir(match.group(1)) notice = [b"/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */\n", b"/* If you are missing that file, acquire a complete release at teeworlds.com. */\n"] exclude = ["../src%sengine%sexternal" % (os.sep, os.sep), "../src%sosxlaunch" % os.sep] diff --git a/scripts/make_release.py b/scripts/make_release.py index f9ff9e94..b056bc4e 100644 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -1,4 +1,7 @@ -import shutil, os, sys, zipfile +import shutil, os, re, sys, zipfile +match = re.search('(.*)/', sys.argv[0]) +if match != None: + os.chdir(match.group(1)) #valid_platforms = ["win32", "linux86", "linux86_64", "src"] |