|
|
@ -24,26 +24,25 @@ pub async fn generate_script_files<P: AsRef<Path>>(output: P) -> AppResult<()> {
|
|
|
|
if !script_dir.exists() {
|
|
|
|
if !script_dir.exists() {
|
|
|
|
fs::create_dir_all(&script_dir).await?;
|
|
|
|
fs::create_dir_all(&script_dir).await?;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let up_path = output.join(&up_script);
|
|
|
|
|
|
|
|
let down_path = output.join(down_script);
|
|
|
|
|
|
|
|
|
|
|
|
fs::write(
|
|
|
|
fs::write(
|
|
|
|
output.join(up_script),
|
|
|
|
&up_path,
|
|
|
|
format!(
|
|
|
|
format!(
|
|
|
|
r#"
|
|
|
|
r#"# Applies all system changes of `{name}`
|
|
|
|
# Applies all system changes of `{name}`
|
|
|
|
|
|
|
|
def main [cfg] {{
|
|
|
|
def main [cfg] {{
|
|
|
|
echo "Executing up task `{name}` with config" $cfg
|
|
|
|
echo "Executing up task `{name}` with config" $cfg
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
"#
|
|
|
|
"#
|
|
|
|
)
|
|
|
|
),
|
|
|
|
.trim(),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
|
fs::write(
|
|
|
|
fs::write(
|
|
|
|
output.join(down_script),
|
|
|
|
&down_path,
|
|
|
|
format!(
|
|
|
|
format!(
|
|
|
|
r#"
|
|
|
|
r#"# Reverts all system changes of `{name}`
|
|
|
|
# Reverts all system changes of `{name}`
|
|
|
|
|
|
|
|
def main [cfg] {{
|
|
|
|
def main [cfg] {{
|
|
|
|
echo "Executing up task `{name}` with config" $cfg
|
|
|
|
echo "Executing up task `{name}` with config" $cfg
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|