nanorc/install.sh

28 lines
512 B
Bash
Raw Normal View History

#!/bin/sh
2015-12-15 04:02:50 +01:00
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
2016-10-14 01:06:30 +02:00
rm /tmp/nanorc.zip
2015-12-15 04:02:50 +01:00
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