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

feat: change install dir to .zm #18

Merged
merged 2 commits into from
Oct 23, 2023
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ brew install zvm
Now add this line to your `~/.bashrc`, `~/.profile`, or `~/.zshrc` file.

```bash
export PATH="$HOME/.zvm/current:$PATH"
export PATH="$HOME/.zm/current:$PATH"
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const std = @import("std");
const builtin = @import("builtin");

const version = std.SemanticVersion{ .major = 0, .minor = 1, .patch = 0 };
const version = std.SemanticVersion{ .major = 0, .minor = 1, .patch = 2 };

// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
Expand Down
6 changes: 3 additions & 3 deletions src/alias.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ pub fn setZigVersion(version: []const u8) !void {
const allocator = std.heap.page_allocator;
const userHome = getUserHome();

const zigPath = try std.fs.path.join(allocator, &[_][]const u8{ userHome, ".zvm", "versions", version });
const zigPath = try std.fs.path.join(allocator, &[_][]const u8{ userHome, ".zm", "versions", version });
defer allocator.free(zigPath);

const symlinkPath = try std.fs.path.join(allocator, &[_][]const u8{ userHome, ".zvm", "current" });
const symlinkPath = try std.fs.path.join(allocator, &[_][]const u8{ userHome, ".zm", "current" });
defer allocator.free(symlinkPath);

try updateSymlink(zigPath, symlinkPath);
Expand Down Expand Up @@ -49,7 +49,7 @@ fn verifyZigVersion(allocator: std.mem.Allocator, expectedVersion: []const u8) !

fn retrieveZigVersion(allocator: std.mem.Allocator) ![]u8 {
const userHome = getUserHome();
const symlinkPath = try std.fs.path.join(allocator, &[_][]const u8{ userHome, ".zvm", "current" });
const symlinkPath = try std.fs.path.join(allocator, &[_][]const u8{ userHome, ".zm", "current" });
defer allocator.free(symlinkPath);

var childProcess = std.ChildProcess.init(&[_][]const u8{ "zig", "version" }, allocator);
Expand Down
2 changes: 1 addition & 1 deletion src/download.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const archive_ext = if (builtin.os.tag == .windows) "zip" else "tar.xz";

fn getZvmPathSegment(segment: []const u8) ![]u8 {
const user_home = std.os.getenv("HOME") orelse ".";
return std.fs.path.join(std.heap.page_allocator, &[_][]const u8{ user_home, ".zvm", segment });
return std.fs.path.join(std.heap.page_allocator, &[_][]const u8{ user_home, ".zm", segment });
}

pub fn content(allocator: std.mem.Allocator, version: []const u8, url: []const u8) !void {
Expand Down
Loading