mirror of
https://github.com/scopatz/nanorc
synced 2024-11-23 19:00:27 +01:00
940b6a866f
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.
28 lines
512 B
Bash
Executable File
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
|