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
23
install.sh
23
install.sh
|
@ -1,7 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PROJECT_ID="org.kde.plasma.clearclock"
|
||||
INSTALL_LOCATION="/home/$USER/.local/share/plasma/plasmoids/"
|
||||
get_project_id() {
|
||||
line=$(grep "^X-KDE-PluginInfo-Name" package/metadata.desktop)
|
||||
IFS='='
|
||||
read -ra array <<< "${line}"
|
||||
projectid=${array[1]}
|
||||
echo ${projectid}
|
||||
}
|
||||
|
||||
PROJECT_ID=$(get_project_id)
|
||||
INSTALL_LOCATION="/home/${USER}/.local/share/plasma/plasmoids/"
|
||||
|
||||
echo "Installing ${PROJECT_ID}"
|
||||
|
||||
if [ ! -d "${INSTALL_LOCATION}" ]; then
|
||||
mkdir "${INSTALL_LOCATION}${PROJECT_ID}"
|
||||
cp -R "package/." "${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