0

Using npm, one can define scripts inside of package.json that can be easily called like

npm run <script-name>

It is very handy to compile/start/lint the project

How are we suppposed to do this with Nimble when using Nim lang?

Alexandre Daubricourt
  • 3,323
  • 1
  • 34
  • 33

2 Answers2

1

Found the way, it is called tasks.

You can define any in your .nimble file (nimble init) like this

task greet, "Print a greeting message":
  exec "echo Hello!"

You can then call

nimble greet
Alexandre Daubricourt
  • 3,323
  • 1
  • 34
  • 33
0

If environment variable XDG_CONFIG_HOME is defined, $XDG_CONFIG_HOME/nim/config.nims or ~/.config/nim/config.nims (POSIX) or %APPDATA%/nim/config.nims (Windows). This file can be skipped with the --skipUserCfg command line option.

$parentDir/config.nims where $parentDir stands for any parent directory of the project file's path. These files can be skipped with the --skipParentCfg command line option.

$projectDir/config.nims where $projectDir stands for the project's path. This file can be skipped with the --skipProjCfg command line option.

A project can also have a project-specific configuration file named $project.nims that resides in the same directory as $project.nim. This file can be skipped with the same --skipProjCfg command line option.

Anton Menshov
  • 2,266
  • 14
  • 34
  • 55
  • 1
    Please see [how do I format my posts](/help/formatting) and format them correctly. This is rather difficult to read at the moment. – Adriaan Nov 29 '22 at 09:39