diff --git a/src/nimblepkg/nimscriptapi.nim b/src/nimblepkg/nimscriptapi.nim index 5abfb99..0e0ce45 100644 --- a/src/nimblepkg/nimscriptapi.nim +++ b/src/nimblepkg/nimscriptapi.nim @@ -40,12 +40,12 @@ when not declared(task): proc `name Task`*() = body let cmd = getCommand() - if cmd.len == 0 or cmd ==? "help": + if cmd.len == 0 or cmd == "help": setCommand "help" - writeTask(astToStr(name), description) - elif cmd ==? astToStr(name): + echo(astToStr(name), " ", description) + elif cmd == astToStr(name): setCommand "nop" - `name Task`() + `name Task`() template before*(action: untyped, body: untyped): untyped = ## Defines a block of code which is evaluated before ``action`` is executed. diff --git a/tests/tester.nim b/tests/tester.nim index 3861c72..b84a620 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -293,7 +293,8 @@ suite "nimscript": test "can list nimscript tasks": cd "nimscript": let (output, exitCode) = execNimble("tasks") - check "work test description".normalize in output.normalize + check "work".normalize in output.normalize + check "test description".normalize in output.normalize check exitCode == QuitSuccess test "can use pre/post hooks":