diff --git a/src/main/nim/strawboss.nim b/src/main/nim/strawboss.nim index 44908ee..6e8c997 100644 --- a/src/main/nim/strawboss.nim +++ b/src/main/nim/strawboss.nim @@ -14,21 +14,17 @@ proc logProcOutput*(outMsg, errMsg: TaintedString, cmd: string) = 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 = """ Usage: - strawboss serve + strawboss serve [options] strawboss run [options] strawboss hashpwd Options + -c --config-file 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 results from building that step before for this version of the project. @@ -41,6 +37,17 @@ Options 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"]: let req = RunRequest(