Skip to content

Commit 842506b

Browse files
authored
Merge pull request #20 from anujdatar/original
Added pacman check to see if python-nautilus is already installed
2 parents 2550ce6 + 32fb1b8 commit 842506b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

code-nautilus.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# VSCode Nautilus Extension
22
#
33
# Place me in ~/.local/share/nautilus-python/extensions/,
4-
# ensure you have python-nautilus package, restrart Nautilus, and enjoy :)
4+
# ensure you have python-nautilus package, restart Nautilus, and enjoy :)
55
#
66
# This script was written by cra0zy and is released to the public domain
77

@@ -45,7 +45,7 @@ def launch_vscode(self, menu, files):
4545
def get_file_items(self, window, files):
4646
item = Nautilus.MenuItem(
4747
name='VSCodeOpen',
48-
label='Open In ' + VSCODENAME,
48+
label='Open in ' + VSCODENAME,
4949
tip='Opens the selected files with VSCode'
5050
)
5151
item.connect('activate', self.launch_vscode, files)
@@ -56,7 +56,7 @@ def get_background_items(self, window, file_):
5656
item = Nautilus.MenuItem(
5757
name='VSCodeOpenBackground',
5858
label='Open in ' + VSCODENAME,
59-
tip='Opens VSCode in the current directory'
59+
tip='Opens the current directory in VSCode'
6060
)
6161
item.connect('activate', self.launch_vscode, [file_])
6262

install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
echo "Installing python-nautilus..."
55
if type "pacman" > /dev/null 2>&1
66
then
7-
sudo pacman -S --noconfirm python-nautilus
7+
# check if already install, else install
8+
pacman -Qi python-nautilus &> /dev/null
9+
if [ `echo $?` -eq 1 ]
10+
then
11+
sudo pacman -S --noconfirm python-nautilus
12+
else
13+
echo "python-nautilus is already installed"
14+
fi
815
elif type "apt-get" > /dev/null 2>&1
916
then
1017
package_name="python-nautilus"
@@ -40,7 +47,7 @@ rm -f ~/.local/share/nautilus-python/extensions/code-nautilus.py
4047

4148
# Download and install the extension
4249
echo "Downloading newest version..."
43-
wget --show-progress -q -O ~/.local/share/nautilus-python/extensions/code-nautilus.py https://raw.githubusercontent.com/cra0zy/code-nautilus/master/code-nautilus.py
50+
wget --show-progress -q -O ~/.local/share/nautilus-python/extensions/code-nautilus.py https://raw.githubusercontent.com/harry-cpp/code-nautilus/master/code-nautilus.py
4451

4552
# Restart nautilus
4653
echo "Restarting nautilus..."

0 commit comments

Comments
 (0)