PortValhalla/scripts/Common/Software/aliae/main.fish

51 lines
1.6 KiB
Fish
Raw Normal View History

2024-07-16 01:30:14 +00:00
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
function configureSW -V dir
source "$dir/../bash/profile.fish"
source "$dir/../fish/profile.fish"
2024-10-06 19:25:34 +00:00
set -l file (pwsh -CommandWithArgs '. $args[0]; Get-GlobalConfigPath' "$dir/Constants.ps1")
2024-07-16 01:30:14 +00:00
sudo install -Dm644 "$dir/aliae.yml" "$file"
begin
2024-07-28 14:57:47 +00:00
printf %s\n \
2024-08-23 22:42:57 +00:00
"if [ -f $(string escape $file) ]" \
2024-10-06 19:25:34 +00:00
then \
2024-08-23 22:42:57 +00:00
" eval \"\$(aliae init bash --config $(string escape $file))\"" \
2024-10-06 19:25:34 +00:00
fi \
2024-08-23 22:42:57 +00:00
'' \
'if [ -n "$ALIAE_CONFIG" ] && [ -f "$ALIAE_CONFIG" ] || [ -f ~/.aliae.yaml ]' \
2024-10-06 19:25:34 +00:00
then \
2024-08-23 22:42:57 +00:00
' eval "$(aliae init bash)"' \
2024-10-06 19:25:34 +00:00
fi \
2024-08-23 22:42:57 +00:00
'' \
'eval "$(aliae completion bash)"'
2024-10-06 19:25:34 +00:00
end | installBashProfile aliae aliae
2024-07-16 01:30:14 +00:00
if type -q fish
begin
printf %s\n \
2024-08-23 22:42:57 +00:00
"if [ -f $(string escape $file) ]" \
" eval \"\$(aliae init bash --config $(string escape $file))\"" \
2024-10-06 19:25:34 +00:00
end \
2024-08-23 22:42:57 +00:00
'' \
'if [ -n "$ALIAE_CONFIG" ] && [ -f "$ALIAE_CONFIG" ] || [ -f ~/.aliae.yaml ]' \
' aliae init fish | source' \
2024-10-06 19:25:34 +00:00
end \
2024-08-23 22:42:57 +00:00
'' \
2024-07-16 01:30:14 +00:00
"aliae completion fish | source"
2024-10-06 19:25:34 +00:00
end | installFishProfile aliae aliae
2024-07-16 01:30:14 +00:00
end
2024-09-19 19:59:37 +00:00
sudo -HE pwsh "$dir/Main.ps1" Configure
2024-07-16 01:30:14 +00:00
end
function userConfig -V dir -a user
runPSUserConfig "$dir/Main.ps1" $user
end
2024-07-16 01:30:14 +00:00
runInstaller $argv
end