Skip to content

Commit 78a3048

Browse files
committed
fix: run cp with bash to expand glob patterns
1 parent 83c1ce3 commit 78a3048

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/run/runner/helpers/apt.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ fn restore_from_cache(system_info: &SystemInfo, cache_dir: &Path) -> Result<()>
155155
.to_str()
156156
.ok_or_else(|| anyhow!("Invalid cache directory path"))?;
157157

158-
run_with_sudo("cp", ["-r", &format!("{cache_dir_str}/*"), "/"])?;
158+
// IMPORTANT: We have to use 'bash' here to ensure that glob patterns are expanded correctly
159+
let copy_cmd = format!("cp -r {cache_dir_str}/* /");
160+
run_with_sudo("bash", ["-c", &copy_cmd])?;
159161

160162
debug!("Cache restored successfully");
161163
Ok(())

0 commit comments

Comments
 (0)