mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
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:
@@ -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"));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user