feat: functionality to open a sandbox workspace in vs code
This commit is contained in:
@@ -97,6 +97,8 @@ pub fn run(h: &Path, o: Opts, image: &str, cmd: Vec<String>, extra: &[String], g
|
||||
.unwrap_or("/".into());
|
||||
let mut s = String::from("B=/.wsbx/busybox\n");
|
||||
s += &format!("$B date -s @{} >/dev/null\n", now());
|
||||
// Some images ship no /etc/hosts: without a localhost entry, Go and others resolve it via DNS and fail.
|
||||
s += "$B grep -qw localhost /etc/hosts 2>/dev/null || printf '127.0.0.1 localhost\\n::1 localhost\\n' >> /etc/hosts\n";
|
||||
s += &format!("$B hostname {name}; echo {name} > /etc/hostname; $B grep -q ' {name}$' /etc/hosts 2>/dev/null || echo '127.0.1.1 {name}' >> /etc/hosts\n");
|
||||
if let Some((rows, cols)) = term_size() {
|
||||
s += &format!("$B stty rows {rows} cols {cols}\n");
|
||||
|
||||
Reference in New Issue
Block a user