1
0
mirror of https://github.com/scopatz/nanorc synced 2024-11-22 08:35:39 +01:00
nanorc/install.sh
Xavier Gouchet 940b6a866f
Update the install script
This fixes the scopatz/nanorc#130 issue by preventing the install script
to sort the ~/.nanorc config file, and only add includes if they're not
already present.
2016-12-10 10:50:00 +01:00

28 lines
512 B
Bash
Executable File

#!/bin/sh
wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/master.zip
if [ ! -d ~/.nano/ ]
then
mkdir ~/.nano/
fi
cd ~/.nano/
unzip -o "/tmp/nanorc.zip"
mv nanorc-master/* ./
rm -rf nanorc-master
rm /tmp/nanorc.zip
if [ ! -f ~/.nanorc ]
then
touch ~/.nanorc
fi
# add all includes from ~/.nano/nanorc if they're not already there
NANORC_FILE=~/.nanorc
while read inc; do
if ! grep -q "$inc" "${NANORC_FILE}"; then
echo "$inc" >> $NANORC_FILE
fi
done < ~/.nano/nanorc