-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathCutCode_linux_x64_installer.sh
More file actions
46 lines (36 loc) · 1.12 KB
/
CutCode_linux_x64_installer.sh
File metadata and controls
46 lines (36 loc) · 1.12 KB
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
45
46
BASE_URL="https://github.com/Abdesol/CutCode/releases/download/"
VERSION="__VERSION__"
FILE="CutCodeLinux.tar.gz"
FOLDER="CutCode __VERSION__ linux x64"
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
#Make cutcode tmp file
rm -rf cutcode-tmp
mkdir cutcode-tmp
cd cutcode-tmp
dialog --infobox "installing CutCode..." 20 60
#Get built files and unzip them
curl -LO $BASE_URL/$VERSION/$FILE
tar -xf $FILE
#make directory to put built files into and put the files
rm -rf /opt/CutCode/
mkdir /opt/CutCode/
cp -r "$FOLDER"/* /opt/CutCode
#make needed file executables
chmod +x /opt/CutCode/CutCode
#add file to /usr/bin/ and make it executable
echo "/opt/CutCode/CutCode" > /usr/bin/CutCode
chmod +x /usr/bin/CutCode
#add .desktop file
cp "$FOLDER"/CutCode.desktop /usr/share/applications/
# Delete the temp file
cd ..
rm -rf cutcode-tmp
whiptail --msgbox "CutCode has been installed successfully"
if whiptail --yesno "Do you want to open CutCode?" 20 60 ;then
CutCode
else
whiptail --msgbox "Thanks for installing CutCode, you can either launch it by running CutCode or search for CutCode in your app drawer" 20 60
fi