mirror of
https://github.com/developersu/ClearClock.git
synced 2025-05-14 19:20:26 +03:00
Revamp install.sh and rename build.sh to package.sh
This commit is contained in:
parent
24e5b43fe3
commit
5e7db336c8
2 changed files with 21 additions and 4 deletions
25
install.sh
25
install.sh
|
@ -1,7 +1,24 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PROJECT_ID="org.kde.plasma.clearclock"
|
get_project_id() {
|
||||||
INSTALL_LOCATION="/home/$USER/.local/share/plasma/plasmoids/"
|
line=$(grep "^X-KDE-PluginInfo-Name" package/metadata.desktop)
|
||||||
|
IFS='='
|
||||||
|
read -ra array <<< "${line}"
|
||||||
|
projectid=${array[1]}
|
||||||
|
echo ${projectid}
|
||||||
|
}
|
||||||
|
|
||||||
mkdir "${INSTALL_LOCATION}${PROJECT_ID}"
|
PROJECT_ID=$(get_project_id)
|
||||||
cp -R "package/." "${INSTALL_LOCATION}${PROJECT_ID}/"
|
INSTALL_LOCATION="/home/${USER}/.local/share/plasma/plasmoids/"
|
||||||
|
|
||||||
|
echo "Installing ${PROJECT_ID}"
|
||||||
|
|
||||||
|
if [ ! -d "${INSTALL_LOCATION}" ]; then
|
||||||
|
mkdir "${INSTALL_LOCATION}${PROJECT_ID}"
|
||||||
|
else
|
||||||
|
echo "Skipping directory creation: directory exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -R "package/." "${INSTALL_LOCATION}${PROJECT_ID}/" &&
|
||||||
|
echo "Successfully installed ${PROJECT_ID} to ${INSTALL_LOCATION}/" ||
|
||||||
|
echo "Installation failed"
|
||||||
|
|
Loading…
Reference in a new issue