diff options
author | 2022-02-12 01:23:32 -0800 | |
---|---|---|
committer | 2022-02-12 01:23:32 -0800 | |
commit | 18b1a36d84593ea71bdae9f42d175b96eb7e99d4 (patch) | |
tree | ca08e59d4eba1795455a1c3816689f041da95be8 | |
parent | 89c99700f664cb4e32f9af1bc4b18ef5064129da (diff) | |
download | bun-18b1a36d84593ea71bdae9f42d175b96eb7e99d4.tar.gz bun-18b1a36d84593ea71bdae9f42d175b96eb7e99d4.tar.zst bun-18b1a36d84593ea71bdae9f42d175b96eb7e99d4.zip |
[bun install] Make global bin dir configurable
-rw-r--r-- | src/api/schema.d.ts | 1 | ||||
-rw-r--r-- | src/api/schema.js | 10 | ||||
-rw-r--r-- | src/api/schema.peechy | 1 | ||||
-rw-r--r-- | src/api/schema.zig | 10 |
4 files changed, 22 insertions, 0 deletions
diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts index 6c667e455..64bd2eff6 100644 --- a/src/api/schema.d.ts +++ b/src/api/schema.d.ts @@ -633,6 +633,7 @@ export interface BunInstall { disable_cache?: boolean; disable_manifest_cache?: boolean; global_dir?: string; + global_bin_dir?: string; } export declare function encodeStackFrame( diff --git a/src/api/schema.js b/src/api/schema.js index 2a1fd8c1d..d6dbfe1c3 100644 --- a/src/api/schema.js +++ b/src/api/schema.js @@ -2906,6 +2906,10 @@ function decodeBunInstall(bb) { result["global_dir"] = bb.readString(); break; + case 18: + result["global_bin_dir"] = bb.readString(); + break; + default: throw new Error("Attempted to parse invalid message"); } @@ -3020,6 +3024,12 @@ function encodeBunInstall(message, bb) { bb.writeByte(17); bb.writeString(value); } + + var value = message["global_bin_dir"]; + if (value != null) { + bb.writeByte(18); + bb.writeString(value); + } bb.writeByte(0); } diff --git a/src/api/schema.peechy b/src/api/schema.peechy index 59c239aa8..64f0844b8 100644 --- a/src/api/schema.peechy +++ b/src/api/schema.peechy @@ -548,4 +548,5 @@ message BunInstall { bool disable_cache = 15; bool disable_manifest_cache = 16; string global_dir = 17; + string global_bin_dir = 18; }
\ No newline at end of file diff --git a/src/api/schema.zig b/src/api/schema.zig index e12eda9d5..7c9344209 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -2722,6 +2722,9 @@ pub const Api = struct { /// global_dir global_dir: ?[]const u8 = null, + /// global_bin_dir + global_bin_dir: ?[]const u8 = null, + pub fn decode(reader: anytype) anyerror!BunInstall { var this = std.mem.zeroes(BunInstall); @@ -2782,6 +2785,9 @@ pub const Api = struct { 17 => { this.global_dir = try reader.readValue([]const u8); }, + 18 => { + this.global_bin_dir = try reader.readValue([]const u8); + }, else => { return error.InvalidMessage; }, @@ -2859,6 +2865,10 @@ pub const Api = struct { try writer.writeFieldID(17); try writer.writeValue(@TypeOf(global_dir), global_dir); } + if (this.global_bin_dir) |global_bin_dir| { + try writer.writeFieldID(18); + try writer.writeValue(@TypeOf(global_bin_dir), global_bin_dir); + } try writer.endMessage(); } }; |