-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·40 lines (35 loc) · 1.02 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
#!/usr/bin/bash
SYMLINK=0
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Usage: $0"
echo "To view this help message:"
echo " $0 --help"
echo "To symlink instead of copying the files:"
echo " $0 -s"
exit 0
elif [ "$1" = "-s" ] || [ "$1" = "--symlink" ]; then
SYMLINK=1
fi
PROJECT_DIR=$(pwd)
if [ ! -f "$PROJECT_DIR/upscaled_vlc.sh" ]; then
echo "Installing from GitHub"
TMPDIR=$(mktemp -d)
git clone https://github.com/adil192/upscaled_vlc "$TMPDIR/upscaled_vlc"
PROJECT_DIR="$TMPDIR/upscaled_vlc"
else
echo "Installing from local files"
fi
function cp_or_symlink() {
if [ $SYMLINK -eq 1 ]; then
echo "ln -sf $@"
ln -sf "$@"
else
echo "cp $@"
cp "$@"
fi
}
cp_or_symlink "$PROJECT_DIR/upscaled_vlc.sh" ~/.local/bin/
cp_or_symlink "$PROJECT_DIR/com.adilhanney.upscaled_vlc.desktop" ~/.local/share/applications/
mkdir -p ~/.local/share/icons/hicolor/scalable/apps/
cp_or_symlink "$PROJECT_DIR/com.adilhanney.upscaled_vlc.svg" ~/.local/share/icons/hicolor/scalable/apps/
rm -rf "$TMPDIR"