Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make zigup configurable through an enviroment #154

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Otherwise, you can manually find and download/extract the applicable archive fro

# Usage

```
```sh
# fetch a compiler and set it as the default
zigup <version>
zigup master
Expand All @@ -26,6 +26,12 @@ zigup default
# set the default compiler
zigup default <version>

# set the default compiler from a path
zigup default zig/build

# unset the default compiler (for using a global installation)
zigup undefine

# list the installed compiler versions
zigup list

Expand All @@ -41,11 +47,12 @@ zigup run <version> <args>...

# How the compilers are managed

zigup stores each compiler in a global "install directory" in a versioned subdirectory. On posix systems the "install directory" is `$HOME/zig` and on windows the install directory will be a directory named "zig" in the same directory as the "zigup.exe".
`zigup` stores each compiler in `$ZIGUP_INSTALL_DIR`, in a versioned subdirectory. The default install directory is `$HOME/.zigup/cache`.

`zigup` makes the zig available by creating a symlink at `$ZIGUP_INSTALL_DIR/<version>` and `$ZIGUP_DIR/default` which points to the current active default compiler.

zigup makes the zig program available by creating an entry in a directory that occurs in the `PATH` environment variable. On posix systems this entry is a symlink to one of the `zig` executables in the install directory. On windows this is an executable that forwards invocations to one of the `zig` executables in the install directory.
Configuration on done during the first use of zigup and the generated environment is installed at `$ZIGUP_DIR/env`.

Both the "install directory" and "path link" are configurable through command-line options `--install-dir` and `--path-link` respectively.
# Building

Run `zig build` to build, `zig build test` to test and install with:
Expand All @@ -56,11 +63,12 @@ cp zig-out/bin/zigup BIN_PATH

# Building Zigup

Zigup is currently built/tested using zig 0.12.0.
Zigup is currently built/tested using zig 0.13.0+.

# TODO

* set/remove compiler in current environment without overriding the system-wide version.
- [ ] Download to memory
- [ ] Use `std.tar` (Unix)

# Dependencies

Expand Down
Loading