File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
migration/cli/migrate-node/docs/cli Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,8 @@ Usage: --environment-box.* [OPTIONS] --rest-api-url <REST_API_URL> --db-dir <DB_
145
145
Options:
146
146
--rest-api-url <REST_API_URL> The rest api url of the box environment
147
147
--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
150
150
-h, --help Print help (see more with '--help')
151
151
152
152
** Selection (3/4):** ` environment-provisioner `
Original file line number Diff line number Diff line change @@ -5,16 +5,26 @@ use tracing::{debug, info};
5
5
use walkdir:: WalkDir ;
6
6
7
7
/// 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 > {
9
9
for entry in WalkDir :: new ( src) {
10
10
let entry = entry?;
11
11
let rel_path = entry. path ( ) . strip_prefix ( src) . unwrap ( ) ;
12
12
let dest_path = dst. join ( rel_path) ;
13
13
14
14
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
+ ) ) ?;
16
21
} 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
+ ) ) ?;
18
28
}
19
29
}
20
30
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments