Builtins: setenv: Raises a ShellCommandError incase of lack of arguments
This commit is contained in:
parent
285eb06f0e
commit
ad3568d785
|
@ -226,7 +226,9 @@ proc runBuiltin(builtin: string, args: openArray[string]): string =
|
|||
return ""
|
||||
of "setenv":
|
||||
if args.len < 2:
|
||||
raise newException(Exception, "setenv: Not enough arguments provided")
|
||||
var e = newException(ShellCommandError, "Setenv: not enough arguments provided")
|
||||
e.command="setenv"
|
||||
raise e
|
||||
try:
|
||||
envVariables[args[0]] = args[1..^1].join(":")
|
||||
putEnv(args[0], args[1..^1].join(":"))
|
||||
|
|
Loading…
Reference in New Issue