nanorc/install.sh

29 lines
553 B
Bash
Raw Normal View History

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