Skip to content

Commit 3e76709

Browse files
committed
debug: permissions error while snapshotting in ci.
1 parent 2fd5dac commit 3e76709

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

migration/cli/migrate-node/docs/cli/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ Usage: --environment-box.* [OPTIONS] --rest-api-url <REST_API_URL> --db-dir <DB_
145145
Options:
146146
--rest-api-url <REST_API_URL> The rest api url of the box environment
147147
--db-dir <DB_DIR> The db dir of the box environment
148-
--snapshot-dir <SNAPSHOT_DIR> Whether to isolate the box environment by snapshotting the movement runner and
149-
where to store the snapshot
148+
--snapshot-dir <SNAPSHOT_DIR> Whether to isolate the box environment by snapshotting the movement runner and where to
149+
store the snapshot
150150
-h, --help Print help (see more with '--help')
151151

152152
**Selection (3/4):** `environment-provisioner`

util/util/src/file.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,26 @@ use tracing::{debug, info};
55
use walkdir::WalkDir;
66

77
/// Copies a directory recursively.
8-
pub fn copy_dir_recursive(src: &Path, dst: &Path) -> std::io::Result<()> {
8+
pub fn copy_dir_recursive(src: &Path, dst: &Path) -> Result<(), anyhow::Error> {
99
for entry in WalkDir::new(src) {
1010
let entry = entry?;
1111
let rel_path = entry.path().strip_prefix(src).unwrap();
1212
let dest_path = dst.join(rel_path);
1313

1414
if entry.file_type().is_dir() {
15-
fs::create_dir_all(&dest_path)?;
15+
let permissions = fs::metadata(&entry.path()).context(format!(
16+
"failed to get permissions while copying directory recursively from {src:?} {entry:?} to {dst:?}"
17+
))?;
18+
fs::create_dir_all(&dest_path).context(format!(
19+
"failed to create directory while copying directory recursively from {src:?} {entry:?} {permissions:?} to {dst:?}"
20+
))?;
1621
} else {
17-
fs::copy(entry.path(), &dest_path)?;
22+
let permissions = fs::metadata(&entry.path()).context(format!(
23+
"failed to get permissions while copying file recursively from {src:?} {entry:?} to {dst:?}"
24+
))?;
25+
fs::copy(entry.path(), &dest_path).context(format!(
26+
"failed to copy file while copying directory recursively from {src:?} {entry:?} {permissions:?} to {dst:?}"
27+
))?;
1828
}
1929
}
2030
Ok(())

0 commit comments

Comments
 (0)