Skip to content

Commit 6c79870

Browse files
committed
Improv.
1 parent 45ff4d4 commit 6c79870

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"zig.zigVersion": "0.12.0-dev.140+e078324db",
3-
"zig.zigPath": "/home/tiramify/.zigd/versions/0.12.0-dev.140+e078324db/zig"
3+
"zig.zigPath": "/usr/bin/zigd"
44
}

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,9 @@
4848

4949
### Why implement own tar.xz extractor?
5050
#### The one in std is very slow, and I couldn't find any other zig implementation of tar.xz extractor.
51-
#### Writing it in zig is also a bit hard so I used libarchive from C and made my own little wrapper for it.
51+
#### Writing it in zig is also a bit hard so I used libarchive from C and made my own little wrapper for it.
52+
53+
## Troubleshooting
54+
55+
### My file gets wiped on save
56+
#### Set `zig.formattingProvider` to `zls`, should fix it.

src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn main() !void {
2020

2121
var env = try std.process.getEnvMap(allocator);
2222
defer env.deinit();
23-
var home = env.get("HOME") orelse unreachable;
23+
var home = env.get("HOME") orelse return error.NoEnv;
2424

2525
const args = try std.process.argsAlloc(allocator);
2626
defer std.process.argsFree(allocator, args);

src/zigd.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub fn setdefault(allocator: std.mem.Allocator, version: []const u8, home: []con
105105
std.debug.print("Did not find zig binary in zigd cache, installing...\n", .{});
106106
const y = try install(allocator, version, home);
107107
allocator.free(y);
108-
break :b std.fs.openDirAbsolute(path, .{}) catch unreachable;
108+
break :b try std.fs.openDirAbsolute(path, .{});
109109
};
110110
z.close();
111111

0 commit comments

Comments
 (0)