From 5b2939b7a50244494efac9326242644c2e2c83de Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 16 Jul 2024 14:28:32 +0200 Subject: [PATCH] Streamline `zoxide` installation --- scripts/Arch/OS/install.fish | 1 + scripts/Arch/Software/zoxide/main.fish | 15 +++++++++++++++ scripts/Common/Software/zoxide/install.ps1 | 12 ++++++++++++ scripts/Common/Software/zoxide/main.fish | 18 ++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 scripts/Arch/Software/zoxide/main.fish create mode 100644 scripts/Common/Software/zoxide/install.ps1 create mode 100644 scripts/Common/Software/zoxide/main.fish diff --git a/scripts/Arch/OS/install.fish b/scripts/Arch/OS/install.fish index 0ee4e39d..dab39210 100644 --- a/scripts/Arch/OS/install.fish +++ b/scripts/Arch/OS/install.fish @@ -44,6 +44,7 @@ begin source "$dir/../Software/openssh/main.fish" source "$dir/../Software/vim/main.fish" source "$dir/../Software/git/main.fish" + source "$dir/../Software/zoxide/main.fish" end if collectionActive common diff --git a/scripts/Arch/Software/zoxide/main.fish b/scripts/Arch/Software/zoxide/main.fish new file mode 100644 index 00000000..eacfe10a --- /dev/null +++ b/scripts/Arch/Software/zoxide/main.fish @@ -0,0 +1,15 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + source "$dir/../../../Common/Software/zoxide/main.fish" + + function installSW + yayinst \ + zoxide + + configureSW + end + + runInstaller $argv +end diff --git a/scripts/Common/Software/zoxide/install.ps1 b/scripts/Common/Software/zoxide/install.ps1 new file mode 100644 index 00000000..34001879 --- /dev/null +++ b/scripts/Common/Software/zoxide/install.ps1 @@ -0,0 +1,12 @@ +#!/bin/pwsh +. "$PSScriptRoot/../powershell/profile.ps1"; + +Add-PowerShellProfileStatement ` + -System ` + -Category "zoxide" ` + -Statement $( + @( + "# zoxide", + $(Get-ScriptInitializer "zoxide init powershell | Out-String") + ) -join [System.Environment]::NewLine + ) diff --git a/scripts/Common/Software/zoxide/main.fish b/scripts/Common/Software/zoxide/main.fish new file mode 100644 index 00000000..0e2fc94e --- /dev/null +++ b/scripts/Common/Software/zoxide/main.fish @@ -0,0 +1,18 @@ +#!/bin/env fish +begin + set -l dir (status dirname) + source "$dir/../../Scripts/software.fish" + + function installSW + configureSW + end + + function configureSW -V dir + source "$dir/../bash/profile.fish" + echo 'eval "$(zoxide init bash)"' | installBashProfile "zoxide" + echo "zoxide init fish | source" | installFishProfile "zoxide" + sudo pwsh -NoProfile "$dir/install.ps1" + end + + runInstaller $argv +end