[bun install] Implement bunfig.toml config

This commit is contained in:
Jarred Sumner
2022-02-11 19:01:00 -08:00
parent bfd7f3398c
commit d67c95d8eb
12 changed files with 977 additions and 86 deletions

View File

@@ -30,3 +30,14 @@ pub fn append(this: *StringBuilder, slice: string) string {
assert(this.len <= this.cap);
return result;
}
const std = @import("std");
pub fn fmt(this: *StringBuilder, comptime str: string, args: anytype) string {
assert(this.len <= this.cap); // didn't count everything
assert(this.ptr != null); // must call allocate first
var buf = this.ptr.?[this.len..this.cap];
const out = std.fmt.bufPrint(buf, str, args) catch unreachable;
this.len += out.len;
return out;
}