also made it a seperate script to prevent bloating the install script.
While testing my changes, I got my .bashrc overwrited cause i forgot to add one more > :smile:
Luckily I was opened ~/.bashrc in nano on another terminal tab before getting it overwrited.
I think importing .use-nala is a good idea because if someone run the install script more than once, .bashrc can get messed up.
Old code was adding the code to .bashrc that configures bash to use nala in every time install script is ran and this was not good. Now, it'll check existence of .use-nala file and it will not re-add the code to .bashrc if it exists.
# For User
$ cat .use-nala
apt() {
command nala "$@"
}
sudo() {
if [ "$1" = "apt" ]; then
shift
command sudo nala "$@"
else
command sudo "$@"
fi
}
$ cat ~/.bashrc
...
if [ -f "/home/nxjoseph/.use-nala" ]; then
. "/home/nxjoseph/.use-nala"
fi
# For Root
# cat ~/.use-nala
apt() {
command nala "$@"
}
# cat ~/.bashrc
...
if [ -f "/root/.use-nala" ]; then
. "/root/.use-nala"
fi
also made it a seperate script to prevent bloating the install script.
While testing my changes, I got my
.bashrc
overwrited cause i forgot to add one more>
:smile: Luckily I was opened~/.bashrc
in nano on another terminal tab before getting it overwrited.I think importing .use-nala is a good idea because if someone run the install script more than once,
.bashrc
can get messed up.Old code was adding the code to
.bashrc
that configures bash to use nala in every time install script is ran and this was not good. Now, it'll check existence of.use-nala
file and it will not re-add the code to.bashrc
if it exists.