Implicitly disable package validation for run/build/compile.

This commit is contained in:
Dominik Picheta 2019-09-22 22:22:21 +01:00
commit 0ed8e6403c

View file

@ -1112,7 +1112,7 @@ proc run(options: Options) =
doCmd("$# $#" % [binaryPath, args], showOutput = true)
proc doAction(options: Options) =
proc doAction(options: var Options) =
if options.showHelp:
writeHelp()
if options.showVersion:
@ -1123,6 +1123,10 @@ proc doAction(options: Options) =
if not existsDir(options.getPkgsDir):
createDir(options.getPkgsDir)
if options.action.typ in {actionTasks, actionRun, actionBuild, actionCompile}:
# Implicitly disable package validation for these commands.
options.disableValidation = true
case options.action.typ
of actionRefresh:
refresh(options)
@ -1177,7 +1181,8 @@ proc doAction(options: Options) =
var execResult: ExecutionResult[bool]
if execCustom(options, execResult, failFast=not isPreDefined):
if execResult.hasTaskRequestedCommand():
doAction(execResult.getOptionsForCommand(options))
var options = execResult.getOptionsForCommand(options)
doAction(options)
else:
# If there is no task defined for the `test` task, we run the pre-defined
# fallback logic.