mirror of
https://github.com/scopatz/nanorc
synced 2024-11-23 19:00:27 +01:00
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.
This commit is contained in:
parent
d2d84b8206
commit
940b6a866f
13
install.sh
13
install.sh
|
@ -1,3 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/master.zip
|
wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/master.zip
|
||||||
if [ ! -d ~/.nano/ ]
|
if [ ! -d ~/.nano/ ]
|
||||||
then
|
then
|
||||||
|
@ -16,7 +18,10 @@ then
|
||||||
touch ~/.nanorc
|
touch ~/.nanorc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat ~/.nano/nanorc >> ~/.nanorc
|
# add all includes from ~/.nano/nanorc if they're not already there
|
||||||
sort -u ~/.nanorc > /tmp/nanorc2
|
NANORC_FILE=~/.nanorc
|
||||||
cat /tmp/nanorc2 > ~/.nanorc
|
while read inc; do
|
||||||
rm /tmp/nanorc2
|
if ! grep -q "$inc" "${NANORC_FILE}"; then
|
||||||
|
echo "$inc" >> $NANORC_FILE
|
||||||
|
fi
|
||||||
|
done < ~/.nano/nanorc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user