2023-04-04 09:07:31 +00:00
|
|
|
#!/bin/bash
|
2024-03-20 21:37:34 +00:00
|
|
|
pushd "${BASH_SOURCE%/*}" > /dev/null;
|
|
|
|
. "../bash/profile.sh";
|
|
|
|
. "../fish/profile.sh";
|
2023-10-24 06:53:16 +00:00
|
|
|
functionName="_PortValhalla_ls_";
|
2023-05-27 21:54:21 +00:00
|
|
|
|
2023-10-24 06:53:16 +00:00
|
|
|
function dump_header() {
|
2023-05-27 21:54:21 +00:00
|
|
|
echo "# logo-ls";
|
2023-10-24 06:53:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function dump_aliases() {
|
|
|
|
echo "alias ls='$functionName'";
|
2023-05-27 21:54:21 +00:00
|
|
|
echo "alias ll='ls -al'";
|
|
|
|
echo "alias l='ls'";
|
2023-10-24 06:53:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
dump_header;
|
|
|
|
echo "function $functionName";
|
|
|
|
echo " if [ -t 1 ]";
|
|
|
|
echo ' logo-ls -D $argv;';
|
|
|
|
echo " else";
|
|
|
|
echo " alias ls=ls;";
|
|
|
|
echo ' ls --color=auto $argv;';
|
|
|
|
echo " alias ls='$functionName';";
|
|
|
|
echo " end";
|
|
|
|
echo "end";
|
|
|
|
echo "";
|
|
|
|
dump_aliases;
|
2024-04-04 14:52:29 +00:00
|
|
|
} | addFishProfile "logo-ls";
|
2023-05-27 21:54:21 +00:00
|
|
|
|
2024-03-20 21:37:34 +00:00
|
|
|
{
|
|
|
|
echo "";
|
|
|
|
dump_header;
|
|
|
|
echo "function ${functionName}() {";
|
|
|
|
echo " if [ -t 1 ]";
|
|
|
|
echo " then";
|
|
|
|
echo ' logo-ls -D "$@";';
|
|
|
|
echo " else";
|
|
|
|
echo ' ls --color=auto "$@";'
|
|
|
|
echo " fi;"
|
|
|
|
echo "}";
|
|
|
|
echo "";
|
|
|
|
dump_aliases;
|
2024-04-04 14:52:29 +00:00
|
|
|
} | addBashProfile "logo-ls";
|
2024-03-20 21:37:34 +00:00
|
|
|
|
|
|
|
popd > /dev/null;
|