DocsGuides
Running scripts
The najova command runs scripts, checks them, and tells your editor about them.
| Command | What it does |
|---|---|
najova run bot.naja | Runs the script until nothing is left waiting. |
najova check bot.naja | Lists mistakes without running anything. |
najova version | Shows which Najova you have. |
Options for najova run
| Option | What it does |
|---|---|
--safe | The script can only reach files in its own folder, and can't use the web. |
--time | Shows how long the run took. |
--allow | Lets an extension's helper program run without asking first. |
Give values to a script
Anything after the script's name ends up in $args, as a list of text.
greet.naja
$let[who;$item[$args;1]]
$let[times;$number[$item[$args;2]]]
$loop[i;1;$get[times]]
$print[Hi $get[who]!]
$endloop najova run greet.naja Lee 2
Hi Lee! Hi Lee!
When the run ends
najova run ends with code 0 when all went well, and 1 after a mistake, so other tools can tell. $exit ends it at once with the code you choose.