mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-05-14 22:16:08 +00:00
Fix init on Windows, update Zmpl for Windows module path fix
This commit is contained in:
parent
499bc69e64
commit
de40af0dc6
@ -3,8 +3,8 @@
|
|||||||
.version = "0.0.0",
|
.version = "0.0.0",
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.zmpl = .{
|
.zmpl = .{
|
||||||
.url = "https://github.com/jetzig-framework/zmpl/archive/ed99a1604b37fb05b0f5843a3288588f3dfe2e63.tar.gz",
|
.url = "https://github.com/jetzig-framework/zmpl/archive/2c98f476dc1b9fb264410146b9a687f0ab955568.tar.gz",
|
||||||
.hash = "1220771fe742fc620872051b92082d370549ed857e5a93ae43f92c5767ca2aaf42b1",
|
.hash = "1220d0f563ecff65c51ca43835917b807f9eac8fb830fdff7c62cfd375a253529274",
|
||||||
},
|
},
|
||||||
.args = .{
|
.args = .{
|
||||||
.url = "https://github.com/MasterQ32/zig-args/archive/89f18a104d9c13763b90e97d6b4ce133da8a3e2b.tar.gz",
|
.url = "https://github.com/MasterQ32/zig-args/archive/89f18a104d9c13763b90e97d6b4ce133da8a3e2b.tar.gz",
|
||||||
|
11
cli/init.zig
11
cli/init.zig
@ -192,7 +192,7 @@ pub fn run(
|
|||||||
null,
|
null,
|
||||||
);
|
);
|
||||||
|
|
||||||
try runCommand(allocator, install_dir, &[_][]const u8{
|
try runCommand(allocator, real_path, &[_][]const u8{
|
||||||
"zig",
|
"zig",
|
||||||
"fetch",
|
"fetch",
|
||||||
"--save",
|
"--save",
|
||||||
@ -219,8 +219,8 @@ pub fn run(
|
|||||||
, .{real_path});
|
, .{real_path});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn runCommand(allocator: std.mem.Allocator, install_dir: std.fs.Dir, argv: []const []const u8) !void {
|
fn runCommand(allocator: std.mem.Allocator, install_path: []const u8, argv: []const []const u8) !void {
|
||||||
const result = try std.process.Child.run(.{ .allocator = allocator, .argv = argv, .cwd_dir = install_dir });
|
const result = try std.process.Child.run(.{ .allocator = allocator, .argv = argv, .cwd = install_path });
|
||||||
defer allocator.free(result.stdout);
|
defer allocator.free(result.stdout);
|
||||||
defer allocator.free(result.stderr);
|
defer allocator.free(result.stderr);
|
||||||
|
|
||||||
@ -381,10 +381,11 @@ fn promptInput(
|
|||||||
const input = try reader.readUntilDelimiterOrEofAlloc(allocator, '\n', max_read_bytes);
|
const input = try reader.readUntilDelimiterOrEofAlloc(allocator, '\n', max_read_bytes);
|
||||||
if (input) |capture| {
|
if (input) |capture| {
|
||||||
defer allocator.free(capture);
|
defer allocator.free(capture);
|
||||||
|
const stripped_input = strip(capture);
|
||||||
|
|
||||||
if (std.mem.eql(u8, capture, "")) {
|
if (std.mem.eql(u8, stripped_input, "")) {
|
||||||
if (options.default) |default| return try allocator.dupe(u8, strip(default));
|
if (options.default) |default| return try allocator.dupe(u8, strip(default));
|
||||||
} else return try allocator.dupe(u8, strip(capture));
|
} else return try allocator.dupe(u8, stripped_input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user