forked from face-hh/webx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-linux
executable file
·37 lines (26 loc) · 1.11 KB
/
install-linux
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
#!/usr/bin/env bash
echo "Building Napture..."
status=$(git status)
# Check if the status contains the phrase "Your branch is behind"
if [[ $status == *"Your branch is behind"* ]]; then
echo "Your branch is behind the remote repository."
echo "Pulling the latest changes..."
git pull origin $(git rev-parse --abbrev-ref HEAD)
elif [[ $status == *"Your branch is up to date"* ]]; then
echo "Your branch is up to date with the remote repository."
else
echo "Failed to determine the repository status."
fi
# Assuming the script is in the same directory as "napture"
cd "$(dirname "$0")/napture" || exit 1
# Build Napture
cargo build --release || exit 1
echo "Installing Napture..."
# Copy files
sudo install -Dm755 ./target/release/webx /usr/bin/napture
sudo install -Dm644 ./io.github.face_hh.Napture.metainfo.xml -t /usr/share/metainfo/
sudo install -Dm644 ./io.github.face_hh.Napture.desktop -t /usr/share/applications/
sudo install -Dm644 ./io.github.face_hh.Napture.svg -t /usr/share/icons/hicolor/scalable/apps/
# Update desktop database
sudo update-desktop-database
echo "Napture installation completed."