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

49 lines
1.7 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-08-23 22:42:57 +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) ]" \
'then' \
" eval \"\$(aliae init bash --config $(string escape $file))\"" \
'fi' \
'' \
'if [ -n "$ALIAE_CONFIG" ] && [ -f "$ALIAE_CONFIG" ] || [ -f ~/.aliae.yaml ]' \
'then' \
' eval "$(aliae init bash)"' \
'fi' \
'' \
'eval "$(aliae completion bash)"'
2024-07-16 01:30:14 +00:00
end | installBashProfile "aliae" "aliae"
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))\"" \
'end' \
'' \
'if [ -n "$ALIAE_CONFIG" ] && [ -f "$ALIAE_CONFIG" ] || [ -f ~/.aliae.yaml ]' \
' aliae init fish | source' \
'end' \
'' \
2024-07-16 01:30:14 +00:00
"aliae completion fish | source"
end | installFishProfile "aliae" "aliae"
end
end
function userConfig -V dir -a user
pwsh -CommandWithArgs '& $args[0] ConfigureUser @{ name=$args[1]; }' "$dir/Main.ps1" $user
end
2024-07-16 01:30:14 +00:00
runInstaller $argv
end