|
4 gadi atpakaļ | |
---|---|---|
.gitignore | 4 gadi atpakaļ | |
README.md | 4 gadi atpakaļ | |
build.zig | 4 gadi atpakaļ | |
zigup.zig | 4 gadi atpakaļ |
Download and manage zig compilers.
# fetch compiler and set it as the default
zigup latest
zigup <version>
# fetch compiler
zigup fetch latest
zigup fetch <version>
# get the default compiler version
zigup default
# set the default compiler
zigup default <version>
# list the installed compiler versions
zigup list
Things that a user may want to configure
PATH
directory that points to the default compilerPATH
directory that calls forwards calls to the default compiler executableI may support one or more configuration files. Possibly a file that lives alongside the executable, or in the user's home directory, possibly both.
On Linux/Bsd/Mac (which I will call "Posix" systems) the default install location is $HOME/zig
. Not sure what default directory to use for windows yet, maybe %APPDATA%\zig
. This directory will contain a unique sub-directory for every version of the compiler that is installed on the system. When a new compiler is installed, this tool will also add some scripts that will modify an environment to use that version of the zig compiler.
One compiler will be set as the "default" by linking a symlink or batch file to one of the compiler executables that have been installed. On Posix systems this will be a symlink named zig
in a PATH
directory that points to one of the zig
executables. On windows this will be a batch file named zig.bat
in a PATH
directoty that calls one of the zig
executables.
My breakdown of the operations I'd like.
zigup fetch latest
)zigup fetch <version>
)zigup list
)zigup default
and zigup default <version>
)set/remove compiler in current environment. Probably require creating a bash/batch script that the user could source for each installed compiler.
download zig index file (zigup fetch-index
)
I think to manage compilers, users can mark them as "keep". The tool will "keep" all compilers marked as "keep" and also the default compiler. I could probably just create an empty file called "keep" to make that mark.
build.zig
assumes it exists alongside this repository.On linux, uses tar
to extract archives
zig build
# install to a bin directory with
cp zig-cache/bin/zigup BIN_PATH