Fix incorrect file extension for fish

This commit is contained in:
Manuel Thalmann 2024-03-25 18:07:40 +01:00
parent c02595a257
commit 694fac8edb
3 changed files with 8 additions and 7 deletions
scripts/Common/Scripts

View file

@ -2,11 +2,12 @@ function addProfileStatement() {
name="$1";
title="$2";
shellBin="$3";
profileRoot="$4";
extension="$4";
profileRoot="$5";
if [ ! -z "${@:5}" ]
if [ ! -z "${@:6}" ]
then
statement="${@:5}";
statement="${@:6}";
else
statement="$(cat)";
fi;
@ -18,9 +19,9 @@ function addProfileStatement() {
echo '#!'"$shellBin";
echo "# $title";
echo "$statement";
} > "profile.sh";
} > "profile.$extension";
sudo install -Dm755 profile.sh "$profileRoot/$name.sh"
sudo install -Dm755 profile.$extension "$profileRoot/$name.$extension"
popd > /dev/null;
rm -rf "$contextRoot";