diff options
author | 2022-02-11 21:15:20 -0800 | |
---|---|---|
committer | 2022-02-11 21:15:20 -0800 | |
commit | 90c573cd42be1abab86db5820d1f6d1666eade8e (patch) | |
tree | a3704ffed2e436c43be27b995de4e9c771fc0cf6 /src/api | |
parent | 71ca909008c70c54cc15ccf39bcd375a1692b92d (diff) | |
download | bun-90c573cd42be1abab86db5820d1f6d1666eade8e.tar.gz bun-90c573cd42be1abab86db5820d1f6d1666eade8e.tar.zst bun-90c573cd42be1abab86db5820d1f6d1666eade8e.zip |
[bun install] Implement global installs
Diffstat (limited to 'src/api')
-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 d896bc160..6c667e455 100644 --- a/src/api/schema.d.ts +++ b/src/api/schema.d.ts @@ -632,6 +632,7 @@ export interface BunInstall { native_bin_links?: string[]; disable_cache?: boolean; disable_manifest_cache?: boolean; + global_dir?: string; } export declare function encodeStackFrame( diff --git a/src/api/schema.js b/src/api/schema.js index 67852d027..2a1fd8c1d 100644 --- a/src/api/schema.js +++ b/src/api/schema.js @@ -2902,6 +2902,10 @@ function decodeBunInstall(bb) { result["disable_manifest_cache"] = !!bb.readByte(); break; + case 17: + result["global_dir"] = bb.readString(); + break; + default: throw new Error("Attempted to parse invalid message"); } @@ -3010,6 +3014,12 @@ function encodeBunInstall(message, bb) { bb.writeByte(16); bb.writeByte(value); } + + var value = message["global_dir"]; + if (value != null) { + bb.writeByte(17); + bb.writeString(value); + } bb.writeByte(0); } diff --git a/src/api/schema.peechy b/src/api/schema.peechy index a7284f713..59c239aa8 100644 --- a/src/api/schema.peechy +++ b/src/api/schema.peechy @@ -547,4 +547,5 @@ message BunInstall { bool disable_cache = 15; bool disable_manifest_cache = 16; + string global_dir = 17; }
\ No newline at end of file diff --git a/src/api/schema.zig b/src/api/schema.zig index 8879b34cb..e12eda9d5 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -2719,6 +2719,9 @@ pub const Api = struct { /// disable_manifest_cache disable_manifest_cache: ?bool = null, + /// global_dir + global_dir: ?[]const u8 = null, + pub fn decode(reader: anytype) anyerror!BunInstall { var this = std.mem.zeroes(BunInstall); @@ -2776,6 +2779,9 @@ pub const Api = struct { 16 => { this.disable_manifest_cache = try reader.readValue(bool); }, + 17 => { + this.global_dir = try reader.readValue([]const u8); + }, else => { return error.InvalidMessage; }, @@ -2849,6 +2855,10 @@ pub const Api = struct { try writer.writeFieldID(16); try writer.writeInt(@as(u8, @boolToInt(disable_manifest_cache))); } + if (this.global_dir) |global_dir| { + try writer.writeFieldID(17); + try writer.writeValue(@TypeOf(global_dir), global_dir); + } try writer.endMessage(); } }; |