choosenim for choosey nimions
The aim of this tool is two-fold:
- Provide an easy way to install the Nim compiler and tools.
- Manage multiple Nim installations and allow them to be selected on-demand.
Basically, it gits nim for you.
Yes, it's different. But not in a scary way; it's open and simple.
This program adds a git subcommand for Nim git nim
and installs itself
next to your Nim compiler so that if your compiler is in your PATH
, so is
gitnim.
No, nimpleton, it's not already installed. 🤦
When you compile the source code, gitnim.nim
, the output is a binary adjacent
to your nim
compiler and named git-nim
.
This binary is detected by git
such that git nim
is a command you can run
on the command-line and it will do a thing.
The git nim
subcommand allows you to choose from precompiled Nim releases and
download or install them by managing your Nim installation as any other git
repository.
Yeah, well, you can keep using your current Nim installation. 🤷
The aim of this tool is two-fold:
- Provide an easy way to install the Nim compiler and tools.
- Manage multiple Nim installations and allow them to be selected on-demand.
If you don't need either of these features, then gitnim is not for you.
This Nim repository also links to the distribution from https://github.com/nim-works/dist, which is a hand-curated monorepo holding the most useful Nim modules from the ecosystem.
When run, gitnim displays or switches branches in the Nim repository and updates the dist submodules to ensure you always have easy access to the latest features and fixes as matched to your active compiler.
Yeah, I know. You're welcome.
We use git for distribution; what else?
$ git clone https://github.com/nim-works/gitnim /somewhere
A critical step; humor me on this one. The location of the compiler is used to infer the installation directory for gitnim itself.
$ export PATH=/somewhere/bin:$PATH
You now have a statically-linked Nim binary for your Linux-x64 system, so you can immediately compile gitnim.
This will automatically install the gitnim binary next to the compiler
binary according to your PATH
, enabling the git nim
subcommand.
$ cd /somewhere
$ nim c gitnim/gitnim.nim
With no additional arguments, git nim
will check the network for updates and
present the available Nim releases for selection.
The current distribution will be updated from the network, if necessary.
$ git nim
When a version is provided, git nim
will switch to that version immediately
without querying the network, provided the version exists locally.
The distribution will be updated without querying the network, if possible.
$ git nim 1.4.3
When a tag is provided, git nim
will switch to the tagged version immediately
without querying the network, provided the tagged reference exists locally.
The distribution will be updated without querying the network, if possible.
$ git nim devel
$ git nim stable
$ git checkout -b "my favorite nims"
$ git remote rename origin upstream
$ git remote add origin "git@github.com:your_name/gitnim.git"
$ git push --set-upstream origin "your branch name"
$ git tag -a "tag_name" -m "your description"
$ git push --tags
$ git push --delete origin tag_name
$ git remote add jeff https://github.com/jeff/gitnim
$ git nim jeff/1.3.3
https://github.com/nim-works/gitnim
MIT