pvincent 7 months ago
parent
commit
ebbea8d451
  1. 2
      init.sh
  2. 2
      install.sh
  3. 2
      uninstall.sh

2
init.sh

@ -15,7 +15,7 @@ readonly ORIGINAL="ORIGINAL"
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
for i in "${arr[@]}"; do for i in "${arr[@]}"; do
if [ ! -f "$i.$ORIGINAL" ]; then
if [[ -f "$i" ]] && [[ ! -f "$i.$ORIGINAL" ]]; then
mv "$i" "$i.$ORIGINAL" mv "$i" "$i.$ORIGINAL"
basefile=$(basename "$i") basefile=$(basename "$i")
ln -s "$MIAOU_BASH_DIR/$basefile" "$i" ln -s "$MIAOU_BASH_DIR/$basefile" "$i"

2
install.sh

@ -3,7 +3,7 @@
## CONSTANTS ## CONSTANTS
readonly CURDIR=$PWD readonly CURDIR=$PWD
readonly REQUIRED_PKGS=(file git bc)
readonly REQUIRED_PKGS=(file git bc vim)
readonly MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz" readonly MAIN_TAR_GZ_URL="https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz"
## FUNCTIONS ## FUNCTIONS

2
uninstall.sh

@ -9,7 +9,7 @@ ORIGINAL="ORIGINAL"
declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc) declare -a arr=(/etc/bash.bashrc /etc/inputrc /etc/vim/vimrc)
for i in "${arr[@]}"; do for i in "${arr[@]}"; do
if [ -f "$i.$ORIGINAL" ]; then
if [[ -f "$i" ]] && [[ -f "$i.$ORIGINAL" ]]; then
echo "uninstalling $i" echo "uninstalling $i"
rm "$i" rm "$i"
mv "$i.$ORIGINAL" "$i" mv "$i.$ORIGINAL" "$i"

Loading…
Cancel
Save