fix(cli/coder): make bootstrap helper async; fix Bun global install when postinstall is blocked\n\nBun can block postinstall; our coder entry bootstraps the native binary.\nIt used an await inside a non-async function, causing a syntax error under Node.\nNow the helper is async and the top-level call awaits it correctly.

This commit is contained in:
James Peter
2025-08-30 13:59:41 +10:00
parent a3a12d329f
commit 9b9e50c323
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ const httpsDownload = (url, dest) => new Promise((resolve, reject) => {
});
});
const tryBootstrapBinary = () => {
const tryBootstrapBinary = async () => {
try {
// 1) Read our published version
const pkg = JSON.parse(readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
+6 -6
View File
@@ -1908,7 +1908,7 @@ fn exec_render_parts_parsed(
}
("Read".to_string(), c)
}
ParsedCommand::ListFiles { cmd, path } => match path {
ParsedCommand::ListFiles { cmd: _, path } => match path {
Some(p) => {
if search_paths.contains(p) {
(String::new(), String::new())
@@ -1918,10 +1918,10 @@ fn exec_render_parts_parsed(
} else {
format!("{}/", p)
};
("List Files".to_string(), display_p)
("List Files".to_string(), format!("in {}", display_p))
}
}
None => ("List Files".to_string(), cmd.clone()),
None => ("List Files".to_string(), "in ./".to_string()),
},
ParsedCommand::Search { query, path, cmd } => {
// Make search terms human-readable:
@@ -4380,7 +4380,7 @@ fn new_parsed_command(
}
("Read".to_string(), c)
}
ParsedCommand::ListFiles { cmd, path } => match path {
ParsedCommand::ListFiles { cmd: _, path } => match path {
Some(p) => {
if search_paths.contains(p) {
(String::new(), String::new()) // suppressed
@@ -4390,10 +4390,10 @@ fn new_parsed_command(
} else {
format!("{p}/")
};
("List Files".to_string(), display_p)
("List Files".to_string(), format!("in {display_p}"))
}
}
None => ("List Files".to_string(), cmd.clone()),
None => ("List Files".to_string(), "in ./".to_string()),
},
ParsedCommand::Search { query, path, cmd } => {
// Format query for display: unescape backslash-escapes and close common unbalanced delimiters