-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall-from-source.sh
executable file
·55 lines (43 loc) · 1.8 KB
/
install-from-source.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
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Check to see if the needed programs are installed:
for program in grep xclip pgrep pkexec whereis wl-copy wl-paste; do
installed=$(command -v $program)
[[ -z "$installed" ]] && echo "$program is not installed, please install it then run this again." && exit 1 || echo "$program is installed"
done
# Set version of required Java, as well as create a variable to check what version of java is installed:
requiredver="17.0.0"
javaver=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
# Now lets do the comparison
if [ "$(printf '%s\n' "$requiredver" "$javaver" | sort -V | head -n1)" = "$requiredver" ]; then
echo "Installed Java Version is greater than ${requiredver}"
else
echo "Java Version installed is less than the required version of: Java ${requiredver} or isn't installed at all."
exit 1
fi
# Set version of required Flutter, as well as re-use the requiredver variable to check what version of flutter is installed:
requiredver="3.16.0"
flutterver=$(flutter --version | awk 'NR==1 {print $2}')
# Now lets do the comparison
if [ "$(printf '%s\n' "$requiredver" "$flutterver" | sort -V | head -n1)" = "$requiredver" ]; then
echo "Installed Flutter Version is greater than ${requiredver}"
else
echo "Flutter Version installed is less than the required version of: Flutter ${requiredver} or isn't installed at all."
exit 1
fi
# bundling
flutter build linux --release
rm -rf package/bundle
cp -r build/linux/x64/release/bundle package/
# preparing /app root
directory="/opt/cliptopia"
if [ -d "$directory" ]; then
echo "App binary root already exists ..."
echo "Reintegrating Cliptopia ..."
else
sudo mkdir $directory
fi
echo " >> Copying Bundle to /opt/cliptopia ..."
sudo cp -r package/bundle/* /opt/cliptopia
# Now lets install
cd package
./integrator