Add function for inheriting fish
installers
This commit is contained in:
parent
d1076f9b2d
commit
4504ca85d4
|
@ -2,14 +2,11 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/Firefox/main.fish"
|
||||
|
||||
function installSW -V dir
|
||||
yayinst firefox
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/Firefox/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/GRUB/main.fish"
|
||||
|
||||
function installSW -V dir
|
||||
pacinst \
|
||||
grub \
|
||||
efibootmgr \
|
||||
os-prober
|
||||
|
||||
fish "$dir/../../../Common/Software/GRUB/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -1,20 +1,12 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/Oh My Posh/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/Oh My Posh/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst oh-my-posh-bin
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -S -V base -a name
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,14 +2,11 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/PowerShell/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst powershell-bin
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/PowerShell/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/Virtual Machine Manager/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/Virtual Machine Manager/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst qemu-full
|
||||
|
@ -17,14 +17,10 @@ begin
|
|||
virt-bootstrap-git
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
function configureSW
|
||||
sudo systemctl enable --now libvirtd
|
||||
sudo systemctl enable --now virtlogd
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base
|
||||
fish "$base" userConfig $argv
|
||||
configureSWBase $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/aliae/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/aliae/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
aliae-bin
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/brave/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst brave-bin (
|
||||
|
@ -10,9 +11,5 @@ begin
|
|||
)
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/brave/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/docker/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/docker/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
|
@ -12,13 +12,5 @@ begin
|
|||
docker-scan
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/git/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/git/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
|
@ -14,13 +14,5 @@ begin
|
|||
gitflow-zshcompletion-avh
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/logo-ls/main.fish"
|
||||
|
||||
function installSW -V dir
|
||||
set -l dirName (realpath "$dir")
|
||||
|
@ -34,9 +35,5 @@ begin
|
|||
end
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/logo-ls/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,14 +2,11 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/minegrub-theme/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst grub-theme-minegrub-git
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/minegrub-theme/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/nix/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
|
@ -13,7 +14,7 @@ begin
|
|||
|
||||
function configureSW -V dir
|
||||
sudo systemctl enable --now nix-daemon
|
||||
fish "$dir/../../../Common/Software/nix/main.fish" configure
|
||||
configureSWBase configure $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/nvidia-dkms/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
|
@ -21,7 +22,7 @@ begin
|
|||
done
|
||||
end | sudo tee /etc/mkinitcpio.conf.d/nvidia.conf >/dev/null
|
||||
|
||||
fish "$dir/../../../Common/Software/nvidia-dkms/main.fish" configure
|
||||
configureSWBase $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -2,14 +2,11 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/pyenv/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst pyenv
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/pyenv/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -1,21 +1,13 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/rclone/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/rclone/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
rclone
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base -a name
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/vim/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst (
|
||||
|
@ -13,10 +14,5 @@ begin
|
|||
wl-clipboard
|
||||
end
|
||||
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/vim/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -2,15 +2,12 @@
|
|||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
inherit "$dir/../../../Common/Software/zoxide/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
zoxide
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/zoxide/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
||||
|
|
|
@ -14,6 +14,28 @@ begin
|
|||
runPSUserAction "$script" ConfigureUser "$name"
|
||||
end
|
||||
|
||||
function inherit -a script -d "Inherits the installer from the specified script."
|
||||
set -l actions \
|
||||
installSW \
|
||||
install \
|
||||
configureSW \
|
||||
configure \
|
||||
userConfig \
|
||||
userConfig
|
||||
|
||||
for i in (seq 1 2 (count $actions))
|
||||
set -l functionName "$actions[$i]Base"
|
||||
|
||||
function $functionName -V script -V actions -V i
|
||||
fish "$script" $actions[(math $i + 1)] $argv
|
||||
end
|
||||
|
||||
function $actions[$i] -V functionName
|
||||
$functionName $argv
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function runInstaller -V dir -a action
|
||||
set -l path (status stack-trace | head -n4 | tail -n1 | string replace --regex -- '^\s*called on line \d+ of file (.*)$' '$1')
|
||||
set -l name (basename (dirname $path))
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/Manage.ps1"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -V dir
|
||||
function configureSW -V dir -V base
|
||||
source "$dir/../bash/profile.fish"
|
||||
source "$dir/../fish/profile.fish"
|
||||
|
||||
|
@ -20,11 +21,11 @@ begin
|
|||
'eval "$(oh-my-posh completion bash)"'
|
||||
end | installBashProfile oh-my-posh
|
||||
|
||||
sudo -HE pwsh "$dir/Manage.ps1" Configure
|
||||
sudo -HE pwsh "$base" Configure
|
||||
end
|
||||
|
||||
function userConfig -S -V dir -a name
|
||||
runPSUserConfig "$dir/Manage.ps1" $name
|
||||
function userConfig -S -V base -a name
|
||||
runPSUserConfig "$base" $name
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/Manage.ps1"
|
||||
source "$(status dirname)/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -S -V dir
|
||||
pwsh "$dir/Manage.ps1" Configure
|
||||
function configureSW -S -V base
|
||||
pwsh "$base" Configure
|
||||
end
|
||||
|
||||
function userConfig -S -V dir -a name
|
||||
runPSUserConfig "$dir/Manage.ps1" $name
|
||||
function userConfig -S -V base -a name
|
||||
runPSUserConfig "$base" $name
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
Loading…
Reference in a new issue