Use function for adding bash profile settings

This commit is contained in:
Manuel Thalmann 2024-03-20 21:15:50 +01:00
parent d601f09a9c
commit 6997511486

View file

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null; pushd "${BASH_SOURCE%/*}" > /dev/null;
. "../bash/profile.sh";
if ! grep "\baliae\b" ~/.bashrc > /dev/null if ! grep "\baliae\b" ~/.bashrc > /dev/null
then then
@ -21,11 +22,8 @@ contextRoot="$(mktemp -d)";
pushd "$contextRoot" > /dev/null; pushd "$contextRoot" > /dev/null;
{ {
dump_bash;
echo 'eval "$(aliae completion bash)"'; echo 'eval "$(aliae completion bash)"';
} > "aliae.sh"; } | addBashProfile "aliae" "aliae";
sudo install -Dm755 aliae.sh /etc/bash/conf.d/aliae.sh
popd > /dev/null; popd > /dev/null;
rm -rf "$contextRoot"; rm -rf "$contextRoot";