autobuild.sh passes through build name to build.py
build.py gives useful error message when no build name is supplied
This commit is contained in:
parent
4a0f2aa5e4
commit
bd2f371d64
@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
./build.py
|
./build.py $*
|
||||||
FORMAT=$(echo "\033[1;33m%w%f\033[0m written")
|
FORMAT=$(echo "\033[1;33m%w%f\033[0m written")
|
||||||
while inotifywait -qre close_write --exclude "iitc-debug.user.js|.git*" --format "$FORMAT" .
|
while inotifywait -qre close_write --exclude "iitc-debug.user.js|.git*" --format "$FORMAT" .
|
||||||
do
|
do
|
||||||
./build.py
|
./build.py $*
|
||||||
done
|
done
|
||||||
|
47
build.py
47
build.py
@ -9,6 +9,33 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
|
# load settings file
|
||||||
|
from buildsettings import buildSettings
|
||||||
|
|
||||||
|
|
||||||
|
# build name from command line
|
||||||
|
if len(sys.argv) != 2: # argv[0] = program, argv[1] = buildname, len=2
|
||||||
|
print "Usage: build.py buildname"
|
||||||
|
print " available build names:", ','.join(buildSettings.keys())
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
buildName = sys.argv[1]
|
||||||
|
|
||||||
|
settings = buildSettings[buildName]
|
||||||
|
|
||||||
|
# set up vars used for replacements
|
||||||
|
|
||||||
|
utcTime = time.gmtime()
|
||||||
|
buildDate = time.strftime('%Y-%m-%d-%H%M%S',utcTime)
|
||||||
|
# userscripts have specific specifications for version numbers - the above date format doesn't match
|
||||||
|
dateTimeVersion = time.strftime('%Y%m%d.%H%M%S',utcTime)
|
||||||
|
|
||||||
|
# extract required values from the settings entry
|
||||||
|
resourceUrlBase = settings['resourceUrlBase']
|
||||||
|
distUrlBase = settings['distUrlBase']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def readfile(fn):
|
def readfile(fn):
|
||||||
with io.open(fn, 'Ur', encoding='utf8') as f:
|
with io.open(fn, 'Ur', encoding='utf8') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
@ -30,26 +57,6 @@ def extractUserScriptMeta(var):
|
|||||||
return m.group(0)
|
return m.group(0)
|
||||||
|
|
||||||
|
|
||||||
# set up vars used for replacements
|
|
||||||
|
|
||||||
|
|
||||||
utcTime = time.gmtime()
|
|
||||||
buildDate = time.strftime('%Y-%m-%d-%H%M%S',utcTime)
|
|
||||||
# userscripts have specific specifications for version numbers - the above date format doesn't match
|
|
||||||
dateTimeVersion = time.strftime('%Y%m%d.%H%M%S',utcTime)
|
|
||||||
|
|
||||||
# build name from command line
|
|
||||||
buildName = sys.argv[1]
|
|
||||||
|
|
||||||
# load settings file
|
|
||||||
from buildsettings import buildSettings
|
|
||||||
settings = buildSettings[buildName]
|
|
||||||
|
|
||||||
# extract required values from the named settings entry
|
|
||||||
resourceUrlBase = settings['resourceUrlBase']
|
|
||||||
distUrlBase = settings['distUrlBase']
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def doReplacements(script,updateUrl,downloadUrl):
|
def doReplacements(script,updateUrl,downloadUrl):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user