Change CLI to allow the config file to be specified as an option.
This commit is contained in:
parent
52b7d2f48b
commit
06b8914e7b
@ -14,21 +14,17 @@ proc logProcOutput*(outMsg, errMsg: TaintedString, cmd: string) =
|
|||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
|
|
||||||
var cfg = loadStrawBossConfig("strawboss.config.json")
|
|
||||||
if not existsDir(cfg.artifactsRepo):
|
|
||||||
echo "Artifacts repo (" & cfg.artifactsRepo & ") does not exist. Creating..."
|
|
||||||
createDir(cfg.artifactsRepo)
|
|
||||||
|
|
||||||
cfg.artifactsRepo = expandFilename(cfg.artifactsRepo)
|
|
||||||
|
|
||||||
let doc = """
|
let doc = """
|
||||||
Usage:
|
Usage:
|
||||||
strawboss serve
|
strawboss serve [options]
|
||||||
strawboss run <project> <step> [options]
|
strawboss run <project> <step> [options]
|
||||||
strawboss hashpwd <pwd>
|
strawboss hashpwd <pwd>
|
||||||
|
|
||||||
Options
|
Options
|
||||||
|
|
||||||
|
-c --config-file <cfgFile> Use this config file instead of the default
|
||||||
|
(strawboss.config.json).
|
||||||
|
|
||||||
-f --force-rebuild Force a build step to re-run even we have cached
|
-f --force-rebuild Force a build step to re-run even we have cached
|
||||||
results from building that step before for this
|
results from building that step before for this
|
||||||
version of the project.
|
version of the project.
|
||||||
@ -41,6 +37,17 @@ Options
|
|||||||
|
|
||||||
let args = docopt(doc, version = "strawboss v" & SB_VER)
|
let args = docopt(doc, version = "strawboss v" & SB_VER)
|
||||||
|
|
||||||
|
let cfgFile = if args["--config-file"]: $args["--config-file"]
|
||||||
|
else: "strawboss.config.json"
|
||||||
|
|
||||||
|
var cfg = loadStrawBossConfig(cfgFile)
|
||||||
|
if not existsDir(cfg.artifactsRepo):
|
||||||
|
echo "Artifacts repo (" & cfg.artifactsRepo & ") does not exist. Creating..."
|
||||||
|
createDir(cfg.artifactsRepo)
|
||||||
|
|
||||||
|
cfg.artifactsRepo = expandFilename(cfg.artifactsRepo)
|
||||||
|
|
||||||
|
|
||||||
if args["run"]:
|
if args["run"]:
|
||||||
|
|
||||||
let req = RunRequest(
|
let req = RunRequest(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user