forked from harry-cpp/code-nautilus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·44 lines (39 loc) · 1.33 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Install python-nautilus
echo "Installing python-nautilus..."
if type "pacman" > /dev/null 2>&1
then
sudo pacman -S --noconfirm python-nautilus
elif type "apt-get" > /dev/null 2>&1
then
installed=`apt list --installed python-nautilus -qq 2> /dev/null`
if [ -z "$installed" ]
then
sudo apt-get install -y python-nautilus
else
echo "python-nautilus is already installed."
fi
elif type "dnf" > /dev/null 2>&1
then
installed=`dnf list --installed nautilus-python 2> /dev/null`
if [ -z "$installed" ]
then
sudo dnf install -y nautilus-python
else
echo "nautilus-python is already installed."
fi
else
echo "Failed to find python-nautilus, please install it manually."
fi
# Remove previous version and setup folder
echo "Removing previous version (if found)..."
mkdir -p ~/.local/share/nautilus-python/extensions
rm -f ~/.local/share/nautilus-python/extensions/VSCodeExtension.py
rm -f ~/.local/share/nautilus-python/extensions/code-nautilus.py
# Download and install the extension
echo "Downloading newest version..."
wget --show-progress -q -O ~/.local/share/nautilus-python/extensions/code-nautilus.py https://raw.githubusercontent.com/cra0zy/code-nautilus/master/code-nautilus.py
# Restart nautilus
echo "Restarting nautilus..."
nautilus -q
echo "Installation Complete"