Skip to content

Commit ddff975

Browse files
authored
Merge pull request harry-cpp#5 from 7aman/master
skip installing python-nautilus if it is already installed
2 parents 2be8b12 + cfa86ba commit ddff975

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

install.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ then
77
sudo pacman -S --noconfirm python-nautilus
88
elif type "apt-get" > /dev/null 2>&1
99
then
10-
sudo apt-get install -y python-nautilus
10+
installed=`apt list --installed python-nautilus -qq 2> /dev/null`
11+
if [ -z "$installed" ]
12+
then
13+
sudo apt-get install -y python-nautilus
14+
else
15+
echo "python-nautilus is already installed."
16+
fi
1117
elif type "dnf" > /dev/null 2>&1
1218
then
13-
sudo dnf install -y nautilus-python
19+
installed=`dnf list --installed nautilus-python 2> /dev/null`
20+
if [ -z "$installed" ]
21+
then
22+
sudo dnf install -y nautilus-python
23+
else
24+
echo "nautilus-python is already installed."
25+
fi
1426
else
1527
echo "Failed to find python-nautilus, please install it manually."
1628
fi
@@ -23,7 +35,7 @@ rm -f ~/.local/share/nautilus-python/extensions/code-nautilus.py
2335

2436
# Download and install the extension
2537
echo "Downloading newest version..."
26-
wget --show-progress -O ~/.local/share/nautilus-python/extensions/code-nautilus.py https://raw.githubusercontent.com/cra0zy/code-nautilus/master/code-nautilus.py
38+
wget --show-progress -q -O ~/.local/share/nautilus-python/extensions/code-nautilus.py https://raw.githubusercontent.com/cra0zy/code-nautilus/master/code-nautilus.py
2739

2840
# Restart nautilus
2941
echo "Restarting nautilus..."

0 commit comments

Comments
 (0)