1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
use std::path::Path;
use anyhow::Result;
use crate::cli::ManifestAction;
use crate::core::manifest::MigrationManifest;
use crate::utils::terminal;
pub fn execute(action: ManifestAction, project_root: &Path) -> Result<()> {
match action {
ManifestAction::Create {
file,
profile,
recipes,
target,
write,
dry_run,
allow_risky,
strict,
autofix,
} => {
let manifest = MigrationManifest {
profile_name: profile,
recipes,
target_path: target,
write,
dry_run,
allow_risky,
strict,
autofix,
review: false,
verbose: false,
summary_only: false,
};
manifest.save_to_file(&file)?;
println!(
"{} Saved migration manifest to {}",
terminal::success_prefix(),
file.display()
);
Ok(())
}
ManifestAction::Run { file } => {
println!("{} Loading manifest: {}", terminal::info_prefix(), file.display());
let manifest = MigrationManifest::load_from_file(&file)?;
println!(
"{} Executing migration manifest targeting: {}",
terminal::info_prefix(),
manifest.target_path.display()
);
// Execute the pipeline using run::execute!
crate::commands::run::execute(
&manifest.recipes,
&manifest.target_path,
manifest.dry_run,
manifest.write,
manifest.review,
manifest.autofix,
manifest.verbose,
manifest.summary_only,
None, // max_preview_lines
manifest.allow_risky,
manifest.strict,
false, // report_json
false, // report_md
Path::new(".morph-cli/reports"), // report_dir
true, // format
false, // prettier
false, // no_format
None, // jobs
false, // sequential
project_root,
None, // package
manifest.profile_name.as_deref(),
None, // output_style
None, // tag
)?;
println!("{} Manifest execution completed!", terminal::success_prefix());
Ok(())
}
}
}