PortValhalla/scripts/Common/Software/logo-ls/main.fish

60 lines
1.5 KiB
Fish
Raw Normal View History

#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
function configureSW -V dir
2024-10-06 19:25:34 +00:00
source "$dir/../bash/profile.fish"
source "$dir/../fish/profile.fish"
set -l functionName _PortValhalla_ls_
function dump_header
echo "# logo-ls"
end
2024-07-28 15:01:24 +00:00
function dump_aliases -V functionName
printf %s\n \
"alias ls='$functionName'" \
"alias ll='ls -al'" \
"alias l='ls'"
end
begin
dump_header
printf %s\n \
"function $functionName() {" \
" if [ -t 1 ]" \
" then" \
' logo-ls -D "$@";' \
" else" \
' ls --color=auto "$@"' \
" fi;" \
"}" \
""
dump_aliases
2024-10-06 19:25:34 +00:00
end | installBashProfile logo-ls
if type -q fish
begin
dump_header
printf %s\n \
"function $functionName" \
" if [ -t 1 ]" \
' logo-ls -D $argv' \
" else" \
' command ls --color=auto $argv' \
" end" \
2024-10-06 19:25:34 +00:00
end \
""
dump_aliases
2024-10-06 19:25:34 +00:00
end | installFishProfile logo-ls
end
end
runInstaller $argv
end