This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/env sh | ||
if [ -f ".temp" ]; then | ||
rm -r ./.temp/ | ||
fi | ||
|
||
mkdir ./.temp/ | ||
cp ../out/artifacts/cmus_rpc_jar/cmus-rpc.jar ./.temp/ | ||
cp ./cmus-rpc.sh ./.temp/ | ||
|
||
|
||
cd ./.temp | ||
|
||
ls | ||
|
||
VER="$1" | ||
echo "Create tar file to cmus-rpc $VER ..." | ||
TARNAME=cmus-rpc-"$VER".tar.gz | ||
tar -cvf "./$TARNAME" ./cmus-rpc.sh ./cmus-rpc.jar | ||
|
||
cd ../.. | ||
if ! [ -f "./release" ]; then | ||
echo "Create release file" | ||
mkdir release | ||
fi | ||
|
||
echo "Move the $TARNAME to release directory." | ||
|
||
mv "./scripts/.temp/$TARNAME" ./release | ||
|
||
echo "Remove temp folder" | ||
rm -r ./scripts/.temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env sh | ||
exec /usr/bin/java -jar /usr/share/java/cmus-rpc/cmus-rpc.jar "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/env sh | ||
|
||
# check sudo permissions | ||
if (( "$EUID" != 0 )); then | ||
echo "Please run this script with sudo" | ||
exit 1 | ||
fi | ||
|
||
|
||
INSTALL_PATH=/usr/share/java/cmus-rpc | ||
VERSION=2.0.0 | ||
|
||
mkdir -p "$INSTALL_PATH" | ||
|
||
echo "Install version: $VERSION" | ||
echo "Downloading jar file..." | ||
sudo wget "https://github.com/Anas-Elgarhy/cmus-rpc/releases/download/$VERSION/cmus-rpc.jar" | ||
sudo mv ./cmus-rpc.jar "$INSTALL_PATH"/cmus-rpc.jar | ||
|
||
printf "\nDownloaded in %s/cmus-rpc.jar\n" $INSTALL_PATH | ||
|
||
echo "Create the executable file in /bin" | ||
# shellcheck disable=SC2024 | ||
sudo echo "exec /usr/bin/java -jar $INSTALL_PATH/cmus-rpc.jar \$@" >> /bin/cmus-rpc | ||
|
||
sudo chmod +x /bin/cmus-rpc | ||
|
||
printf "\nDone, enjoy :D\n" | ||
|
||
echo "Please type cmus-rpc --help to show the available options" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/env sh | ||
|
||
VER="@1" | ||
|
||
if [ -z $VER ];then | ||
echo "Please pass the version." | ||
exit 1 | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/env sh | ||
|
||
if (( "$EUID" != 0 )); then | ||
echo "Please this script with sudo!" | ||
exit 1 | ||
fi | ||
|
||
echo "Remove jar file.." | ||
sudo rm -r /usr/share/java/cmus-rpc | ||
|
||
echo "Remove execrable file..." | ||
sudo rm /bin/cmus-rpc | ||
|
||
echo "Done :/" | ||
|