Skip to content

Commit

Permalink
Improv.
Browse files Browse the repository at this point in the history
  • Loading branch information
trnxdev committed Aug 21, 2023
1 parent 45ff4d4 commit 6c79870
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"zig.zigVersion": "0.12.0-dev.140+e078324db",
"zig.zigPath": "/home/tiramify/.zigd/versions/0.12.0-dev.140+e078324db/zig"
"zig.zigPath": "/usr/bin/zigd"
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@

### Why implement own tar.xz extractor?
#### The one in std is very slow, and I couldn't find any other zig implementation of tar.xz extractor.
#### Writing it in zig is also a bit hard so I used libarchive from C and made my own little wrapper for it.
#### Writing it in zig is also a bit hard so I used libarchive from C and made my own little wrapper for it.

## Troubleshooting

### My file gets wiped on save
#### Set `zig.formattingProvider` to `zls`, should fix it.
2 changes: 1 addition & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn main() !void {

var env = try std.process.getEnvMap(allocator);
defer env.deinit();
var home = env.get("HOME") orelse unreachable;
var home = env.get("HOME") orelse return error.NoEnv;

const args = try std.process.argsAlloc(allocator);
defer std.process.argsFree(allocator, args);
Expand Down
2 changes: 1 addition & 1 deletion src/zigd.zig
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn setdefault(allocator: std.mem.Allocator, version: []const u8, home: []con
std.debug.print("Did not find zig binary in zigd cache, installing...\n", .{});
const y = try install(allocator, version, home);
allocator.free(y);
break :b std.fs.openDirAbsolute(path, .{}) catch unreachable;
break :b try std.fs.openDirAbsolute(path, .{});
};
z.close();

Expand Down

0 comments on commit 6c79870

Please sign in to comment.