4 Commits

Author SHA1 Message Date
utox39
428d882591 Merge pull request #10 from utox39/feat/handle-shell-env-var-not-found
Feat/handle shell env var not found
2025-08-04 00:40:29 +02:00
utox39
a1c62a56ae build: bump version to 0.8.1 2025-08-04 00:38:33 +02:00
utox39
5b423d1cef feat(shell): handle 'SHELL' env var not found 2025-08-04 00:35:09 +02:00
utox39
6574945e56 docs(README): update README 2025-08-02 00:25:25 +02:00
4 changed files with 8 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ $ cp /path/to/zigfetch/config.json ~/.config/zigfetch/config.json
## Roadtrip ## Roadtrip
- [ ] Add ASCII art for each operating system and Linux distro - [ ] Add ASCII art for each operating system and Linux distro
- [ ] Add GPU info for Linux - [x] Add GPU info for Linux
- [ ] Add packages info for Linux - [ ] Add packages info for Linux
- [x] Add user customization - [x] Add user customization
- [ ] Add support for Windows - [ ] Add support for Windows

View File

@@ -10,7 +10,7 @@
// This is a [Semantic Version](https://semver.org/). // This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication. // In a future version of Zig it will be used for package deduplication.
.version = "0.8.0", .version = "0.8.1",
// Together with name, this represents a globally unique package // Together with name, this represents a globally unique package
// identifier. This field is generated by the Zig toolchain when the // identifier. This field is generated by the Zig toolchain when the

View File

@@ -6,7 +6,9 @@ pub fn getUsername(allocator: std.mem.Allocator) ![]u8 {
} }
pub fn getShell(allocator: std.mem.Allocator) ![]u8 { pub fn getShell(allocator: std.mem.Allocator) ![]u8 {
const shell = try std.process.getEnvVarOwned(allocator, "SHELL"); const shell = std.process.getEnvVarOwned(allocator, "SHELL") catch |err| if (err == error.EnvironmentVariableNotFound) {
return allocator.dupe(u8, "Unknown");
} else return err;
var child = std.process.Child.init(&[_][]const u8{ shell, "--version" }, allocator); var child = std.process.Child.init(&[_][]const u8{ shell, "--version" }, allocator);
defer allocator.free(shell); defer allocator.free(shell);

View File

@@ -9,7 +9,9 @@ pub fn getUsername(allocator: std.mem.Allocator) ![]u8 {
} }
pub fn getShell(allocator: std.mem.Allocator) ![]u8 { pub fn getShell(allocator: std.mem.Allocator) ![]u8 {
const shell = try std.process.getEnvVarOwned(allocator, "SHELL"); const shell = std.process.getEnvVarOwned(allocator, "SHELL") catch |err| if (err == error.EnvironmentVariableNotFound) {
return allocator.dupe(u8, "Unknown");
} else return err;
var child = std.process.Child.init(&[_][]const u8{ shell, "--version" }, allocator); var child = std.process.Child.init(&[_][]const u8{ shell, "--version" }, allocator);
defer allocator.free(shell); defer allocator.free(shell);