| author | |
| committer | |
| log | 4c13de3183c369d6d1260e34cf32619c63526481 |
| tree | 1de51bf76a7dc018bf7fe1bc327e172a0bcd6714 |
| parent | 3053f65a9e95eae137ea3427d6a866847f55e42e |
13 files changed, 64 insertions(+), 14 deletions(-)
src/cmd/aq.zig-1| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | ||
| 5 | 4 | const zfetch = @import("zfetch"); |
| 6 | 5 | const json = @import("json"); |
| 7 | 6 |
src/cmd/aquila/install.zig-1| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | ||
| 5 | 4 | const knownfolders = @import("known-folders"); |
| 6 | 5 | |
| 7 | 6 | const zigmod = @import("../../lib.zig"); |
src/cmd/fetch.zig+2-2| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | const ansi = @import("ansi"); | |
| 4 | const root = @import("root"); | |
| 3 | 5 | |
| 4 | 6 | const zigmod = @import("../lib.zig"); |
| 5 | 7 | const u = @import("./../util/index.zig"); |
| 6 | 8 | const common = @import("./../common.zig"); |
| 7 | 9 | |
| 8 | const ansi = @import("ansi"); | |
| 9 | const root = @import("root"); | |
| 10 | 10 | const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {}; |
| 11 | 11 | const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false; |
| 12 | 12 |
src/cmd/init.zig-1| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | ||
| 5 | 4 | const inquirer = @import("inquirer"); |
| 6 | 5 | const detectlicense = @import("detect-license"); |
| 7 | 6 | const knownfolders = @import("known-folders"); |
src/cmd/license.zig-1| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const gpa = std.heap.c_allocator; |
| 3 | ||
| 4 | 3 | const style = @import("ansi").style; |
| 5 | 4 | const licenses = @import("licenses"); |
| 6 | 5 |
src/cmd/test.zig created+61| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | const std = @import("std"); | |
| 2 | const string = []const u8; | |
| 3 | const gpa = std.heap.c_allocator; | |
| 4 | const range = @import("range").range; | |
| 5 | const zfetch = @import("zfetch"); | |
| 6 | const ansi = @import("ansi"); | |
| 7 | ||
| 8 | // | |
| 9 | // | |
| 10 | ||
| 11 | // https://www.thinkbroadband.com/download | |
| 12 | ||
| 13 | const Progress = struct { | |
| 14 | const Item = struct { | |
| 15 | max: usize, | |
| 16 | current: usize, | |
| 17 | done: bool, | |
| 18 | }; | |
| 19 | }; | |
| 20 | ||
| 21 | var progress: std.ArrayList(Progress.Item) = undefined; | |
| 22 | var left: usize = 0; | |
| 23 | ||
| 24 | pub fn execute(args: [][]u8) !void { | |
| 25 | _ = args; | |
| 26 | // progress = std.ArrayList(Progress.Item).init(gpa); | |
| 27 | // std.debug.print("\n", .{}); | |
| 28 | ||
| 29 | // for (range(3)) |_, i| { | |
| 30 | // try progress.append(.{ .max = 1, .current = 0, .done = false }); | |
| 31 | // left += 1; | |
| 32 | // try download("http://ipv4.download.thinkbroadband.com/100MB.zip", i); | |
| 33 | // } | |
| 34 | ||
| 35 | // while (left > 0) { | |
| 36 | // for (progress.items) |it, i| { | |
| 37 | // std.debug.print("{d}\t{d}\t{d}\t{d}%\n", .{ i, it.current, it.max, @divExact(it.current, it.max) }); | |
| 38 | // } | |
| 39 | // std.debug.print("\n", .{}); | |
| 40 | // } | |
| 41 | // for (progress.items) |it, i| { | |
| 42 | // std.debug.print("{d}\t{d}\t{d}\t{d}%\n", .{ i, it.current, it.max, @divExact(it.current, it.max) }); | |
| 43 | // } | |
| 44 | } | |
| 45 | ||
| 46 | fn download(url: string, index: usize) void { | |
| 47 | const req = zfetch.Request.init(gpa, url, null) catch {}; | |
| 48 | defer req.deinit(); | |
| 49 | ||
| 50 | req.do(.GET, null, null) catch {}; | |
| 51 | ||
| 52 | var buf: [std.mem.page_size]u8 = undefined; | |
| 53 | const r = req.reader(); | |
| 54 | while (true) { | |
| 55 | const len = r.readAll(&buf) catch {}; | |
| 56 | progress.items[index].current += len; | |
| 57 | if (len < buf.len) break; | |
| 58 | } | |
| 59 | progress.items[index].done = true; | |
| 60 | left -= 1; | |
| 61 | } |
src/cmd/zpm.zig-1| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const gpa = std.heap.c_allocator; |
| 4 | ||
| 5 | 4 | const zfetch = @import("zfetch"); |
| 6 | 5 | const json = @import("json"); |
| 7 | 6 |
src/cmd/zpm/add.zig-1| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const gpa = std.heap.c_allocator; |
| 3 | ||
| 4 | 3 | const zfetch = @import("zfetch"); |
| 5 | 4 | |
| 6 | 5 | const zigmod = @import("../../lib.zig"); |
src/cmd/zpm/search.zig-1| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const gpa = std.heap.c_allocator; |
| 3 | ||
| 4 | 3 | const zfetch = @import("zfetch"); |
| 5 | 4 | const json = @import("json"); |
| 6 | 5 | const range = @import("range").range; |
src/cmd/zpm/showjson.zig-1| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const gpa = std.heap.c_allocator; |
| 3 | ||
| 4 | 3 | const zfetch = @import("zfetch"); |
| 5 | 4 | const json = @import("json"); |
| 6 | 5 |
src/cmd/zpm/tags.zig-1| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const gpa = std.heap.c_allocator; |
| 3 | ||
| 4 | 3 | const zfetch = @import("zfetch"); |
| 5 | 4 | const json = @import("json"); |
| 6 | 5 | const range = @import("range").range; |
src/common.zig+1-2| ... | ... | @@ -1,14 +1,13 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const builtin = @import("builtin"); |
| 4 | ||
| 5 | 4 | const ansi = @import("ansi"); |
| 5 | const root = @import("root"); | |
| 6 | 6 | |
| 7 | 7 | const zigmod = @import("./lib.zig"); |
| 8 | 8 | const u = @import("./util/index.zig"); |
| 9 | 9 | const yaml = @import("./util/yaml.zig"); |
| 10 | 10 | |
| 11 | const root = @import("root"); | |
| 12 | 11 | const build_options = if (@hasDecl(root, "build_options")) root.build_options else struct {}; |
| 13 | 12 | const bootstrap = if (@hasDecl(build_options, "bootstrap")) build_options.bootstrap else false; |
| 14 | 13 |
src/main.zig-1| ... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | 3 | const builtin = @import("builtin"); |
| 4 | ||
| 5 | 4 | pub const build_options = @import("build_options"); |
| 6 | 5 | const zigmod = @import("zigmod"); |
| 7 | 6 | const win32 = @import("win32"); |