| ... | @@ -1,6 +1,7 @@ | ... | @@ -1,6 +1,7 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const gpa = std.heap.c_allocator; | 2 | const gpa = std.heap.c_allocator; |
| 3 | | 3 | |
| | 4 | const string = []const u8; |
| 4 | | 5 | |
| 5 | const u = @import("./../util/index.zig"); | 6 | const u = @import("./../util/index.zig"); |
| 6 | const common = @import("./../common.zig"); | 7 | const common = @import("./../common.zig"); |
| ... | @@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void { | ... | @@ -33,7 +34,7 @@ pub fn execute(args: [][]u8) !void { |
| 33 | try create_lockfile(list, dir); | 34 | try create_lockfile(list, dir); |
| 34 | } | 35 | } |
| 35 | | 36 | |
| 36 | pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayList(u.Module)) !void { | 37 | pub fn create_depszig(dir: string, top_module: u.Module, list: *std.ArrayList(u.Module)) !void { |
| 37 | const f = try std.fs.cwd().createFile("deps.zig", .{}); | 38 | const f = try std.fs.cwd().createFile("deps.zig", .{}); |
| 38 | defer f.close(); | 39 | defer f.close(); |
| 39 | | 40 | |
| ... | @@ -110,7 +111,7 @@ pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayLis | ... | @@ -110,7 +111,7 @@ pub fn create_depszig(dir: []const u8, top_module: u.Module, list: *std.ArrayLis |
| 110 | try w.writeAll("};\n\n"); | 111 | try w.writeAll("};\n\n"); |
| 111 | } | 112 | } |
| 112 | | 113 | |
| 113 | fn create_lockfile(list: *std.ArrayList(u.Module), dir: []const u8) !void { | 114 | fn create_lockfile(list: *std.ArrayList(u.Module), dir: string) !void { |
| 114 | const fl = try std.fs.cwd().createFile("zigmod.lock", .{}); | 115 | const fl = try std.fs.cwd().createFile("zigmod.lock", .{}); |
| 115 | defer fl.close(); | 116 | defer fl.close(); |
| 116 | | 117 | |
| ... | @@ -254,7 +255,7 @@ fn print_pkgs(w: std.fs.File.Writer, m: u.Module) !void { | ... | @@ -254,7 +255,7 @@ fn print_pkgs(w: std.fs.File.Writer, m: u.Module) !void { |
| 254 | try w.writeAll("}"); | 255 | try w.writeAll("}"); |
| 255 | } | 256 | } |
| 256 | | 257 | |
| 257 | fn print_imports(w: std.fs.File.Writer, m: u.Module, dir: []const u8) !void { | 258 | fn print_imports(w: std.fs.File.Writer, m: u.Module, dir: string) !void { |
| 258 | for (m.deps) |d| { | 259 | for (m.deps) |d| { |
| 259 | if (d.main.len == 0) { | 260 | if (d.main.len == 0) { |
| 260 | continue; | 261 | continue; |