Fixes #713 and adds test for --depsOnly.
This commit is contained in:
parent
419eba036b
commit
da3f70cb98
2 changed files with 16 additions and 0 deletions
|
|
@ -390,9 +390,18 @@ proc parseMisc(options: var Options) =
|
|||
|
||||
proc handleUnknownFlags(options: var Options) =
|
||||
if options.action.typ == actionRun:
|
||||
# ActionRun uses flags that come before the command as compilation flags
|
||||
# and flags that come after as run flags.
|
||||
options.action.compileFlags =
|
||||
map(options.unknownFlags, x => getFlagString(x[0], x[1], x[2]))
|
||||
options.unknownFlags = @[]
|
||||
else:
|
||||
# For everything else, handle the flags that came before the command
|
||||
# normally.
|
||||
let unknownFlags = options.unknownFlags
|
||||
options.unknownFlags = @[]
|
||||
for flag in unknownFlags:
|
||||
parseFlag(flag[1], flag[2], options, flag[0])
|
||||
|
||||
# Any unhandled flags?
|
||||
if options.unknownFlags.len > 0:
|
||||
|
|
|
|||
|
|
@ -79,6 +79,13 @@ proc hasLineStartingWith(lines: seq[string], prefix: string): bool =
|
|||
return true
|
||||
return false
|
||||
|
||||
test "depsOnly + flag order test":
|
||||
var (output, exitCode) = execNimble(
|
||||
"--depsOnly", "install", "-y", "https://github.com/nimble-test/packagebin2"
|
||||
)
|
||||
check(not output.contains("Success: packagebin2 installed successfully."))
|
||||
check exitCode == QuitSuccess
|
||||
|
||||
test "caching of nims and ini detects changes":
|
||||
cd "caching":
|
||||
var (output, exitCode) = execNimble("dump")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue