From 07fe67df244b943438752855284e62d2ce739e4e Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 17 Oct 2022 21:39:52 +0200 Subject: [PATCH] Add newline to end of all script files --- configs/crystal/configure-locale/up.nu | 2 +- configs/crystal/configure-network/up.nu | 2 +- configs/crystal/configure-unakite/up.nu | 2 +- configs/crystal/create-partitions/up.nu | 2 +- configs/crystal/install-base/up.nu | 2 +- configs/crystal/install-bootloader/up.nu | 2 +- configs/crystal/install-desktop/up.nu | 2 +- configs/crystal/install-extra-packages/up.nu | 2 +- configs/crystal/install-flatpak/up.nu | 2 +- configs/crystal/install-kernels/up.nu | 2 +- configs/crystal/install-timeshift/up.nu | 2 +- configs/crystal/install-zramd/up.nu | 2 +- configs/crystal/setup-root-user/up.nu | 2 +- configs/crystal/setup-users/up.nu | 2 +- src/utils.rs | 19 +++++++++---------- 15 files changed, 23 insertions(+), 24 deletions(-) diff --git a/configs/crystal/configure-locale/up.nu b/configs/crystal/configure-locale/up.nu index a1d5a02..193ce9d 100644 --- a/configs/crystal/configure-locale/up.nu +++ b/configs/crystal/configure-locale/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `configure-locale` def main [cfg] { echo "Executing up task `configure-locale` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/configure-network/up.nu b/configs/crystal/configure-network/up.nu index 80a48c7..fdbf12c 100644 --- a/configs/crystal/configure-network/up.nu +++ b/configs/crystal/configure-network/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `configure-network` def main [cfg] { echo "Executing up task `configure-network` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/configure-unakite/up.nu b/configs/crystal/configure-unakite/up.nu index 134cdd1..9b2728a 100644 --- a/configs/crystal/configure-unakite/up.nu +++ b/configs/crystal/configure-unakite/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `configure-unakite` def main [cfg] { echo "Executing up task `configure-unakite` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/create-partitions/up.nu b/configs/crystal/create-partitions/up.nu index 567a536..cbb7334 100644 --- a/configs/crystal/create-partitions/up.nu +++ b/configs/crystal/create-partitions/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `create-partitions` def main [cfg] { echo "Executing up task `create-partitions` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-base/up.nu b/configs/crystal/install-base/up.nu index 48d2c8a..3fbee4f 100644 --- a/configs/crystal/install-base/up.nu +++ b/configs/crystal/install-base/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-base` def main [cfg] { echo "Executing up task `install-base` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-bootloader/up.nu b/configs/crystal/install-bootloader/up.nu index 100fdf3..5cf68ad 100644 --- a/configs/crystal/install-bootloader/up.nu +++ b/configs/crystal/install-bootloader/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-bootloader` def main [cfg] { echo "Executing up task `install-bootloader` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-desktop/up.nu b/configs/crystal/install-desktop/up.nu index 2dddfc0..82a6ceb 100644 --- a/configs/crystal/install-desktop/up.nu +++ b/configs/crystal/install-desktop/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-desktop` def main [cfg] { echo "Executing up task `install-desktop` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-extra-packages/up.nu b/configs/crystal/install-extra-packages/up.nu index ba6e5cc..01c2b85 100644 --- a/configs/crystal/install-extra-packages/up.nu +++ b/configs/crystal/install-extra-packages/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-extra-packages` def main [cfg] { echo "Executing up task `install-extra-packages` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-flatpak/up.nu b/configs/crystal/install-flatpak/up.nu index 481f30a..c8b8f88 100644 --- a/configs/crystal/install-flatpak/up.nu +++ b/configs/crystal/install-flatpak/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-flatpak` def main [cfg] { echo "Executing up task `install-flatpak` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-kernels/up.nu b/configs/crystal/install-kernels/up.nu index 647dfec..821a7c9 100644 --- a/configs/crystal/install-kernels/up.nu +++ b/configs/crystal/install-kernels/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-kernels` def main [cfg] { echo "Executing up task `install-kernels` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-timeshift/up.nu b/configs/crystal/install-timeshift/up.nu index 1423168..1f8fc39 100644 --- a/configs/crystal/install-timeshift/up.nu +++ b/configs/crystal/install-timeshift/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-timeshift` def main [cfg] { echo "Executing up task `install-timeshift` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/install-zramd/up.nu b/configs/crystal/install-zramd/up.nu index 37a98df..7ccc0e2 100644 --- a/configs/crystal/install-zramd/up.nu +++ b/configs/crystal/install-zramd/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `install-zramd` def main [cfg] { echo "Executing up task `install-zramd` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/setup-root-user/up.nu b/configs/crystal/setup-root-user/up.nu index f96c857..76ef853 100644 --- a/configs/crystal/setup-root-user/up.nu +++ b/configs/crystal/setup-root-user/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `setup-root-user` def main [cfg] { echo "Executing up task `setup-root-user` with config" $cfg -} \ No newline at end of file +} diff --git a/configs/crystal/setup-users/up.nu b/configs/crystal/setup-users/up.nu index b057f1b..8b5f6fe 100644 --- a/configs/crystal/setup-users/up.nu +++ b/configs/crystal/setup-users/up.nu @@ -1,4 +1,4 @@ # Applies all system changes of `setup-users` def main [cfg] { echo "Executing up task `setup-users` with config" $cfg -} \ No newline at end of file +} diff --git a/src/utils.rs b/src/utils.rs index 365e3a3..d60d0f4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -24,30 +24,29 @@ pub async fn generate_script_files>(output: P) -> AppResult<()> { if !script_dir.exists() { fs::create_dir_all(&script_dir).await?; } + let up_path = output.join(&up_script); + let down_path = output.join(down_script); fs::write( - output.join(up_script), + &up_path, format!( - r#" -# Applies all system changes of `{name}` + r#"# Applies all system changes of `{name}` def main [cfg] {{ echo "Executing up task `{name}` with config" $cfg }} - "# - ) - .trim(), +"# + ), ) .await?; fs::write( - output.join(down_script), + &down_path, format!( - r#" -# Reverts all system changes of `{name}` + r#"# Reverts all system changes of `{name}` def main [cfg] {{ echo "Executing up task `{name}` with config" $cfg }} - "# +"# ) .trim(), )