Builtins: set: Throws an exception if not enough arguments are provided
This commit is contained in:
parent
aa528eb717
commit
285eb06f0e
|
@ -164,7 +164,6 @@ proc evalVariable(vari: string): string =
|
|||
else:
|
||||
var e = newException(ShellVariableError, "No such variable: " & vari)
|
||||
e.variable = vari
|
||||
e.msg = "No such variable: " & e.variable
|
||||
raise e
|
||||
|
||||
# substitute does a substitution on the stream passed in
|
||||
|
@ -220,7 +219,9 @@ proc runBuiltin(builtin: string, args: openArray[string]): string =
|
|||
case builtin:
|
||||
of "set":
|
||||
if args.len < 2:
|
||||
raise newException(Exception, "Set: not enough arguments provided")
|
||||
var e = newException(ShellCommandError, "Set: not enough arguments provided")
|
||||
e.command="set"
|
||||
raise e
|
||||
shellVariables[args[0]] = args[1..^1].join(" ")
|
||||
return ""
|
||||
of "setenv":
|
||||
|
|
Loading…
Reference in New Issue