Skip to content

Commit eee1d91

Browse files
committed
Revamp package.sh and use the HOME variable in install.sh
1 parent 2280d0a commit eee1d91

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ get_project_id() {
99
}
1010

1111
PROJECT_ID=$(get_project_id)
12-
INSTALL_LOCATION="/home/${USER}/.local/share/plasma/plasmoids/"
12+
INSTALL_LOCATION="${HOME}/.local/share/plasma/plasmoids/"
1313

1414
echo "Installing ${PROJECT_ID}"
1515

package.sh

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
#!/usr/bin/env bash
22

3-
PACKAGE_NAME="ClearClock"
3+
prompt() {
4+
while true; do
5+
echo -e "$1 [y/n]: "
6+
read -r yn
7+
case ${yn} in
8+
[Yy]*) return 0 ;;
9+
[Nn]*) return 1 ;;
10+
esac
11+
done
12+
}
13+
14+
get_project_name() {
15+
line=$(grep "^Name" package/metadata.desktop)
16+
IFS='='
17+
read -ra array <<< "${line}"
18+
projectname=${array[1]}
19+
echo ${projectname}
20+
}
21+
22+
PACKAGE_NAME=$(get_project_name)
423

524
tar -czvf "${PACKAGE_NAME}.tar.gz" -C "package/" .
6-
git add .
7-
git commit -m "Update package"
25+
26+
prompt "Do you want to commit and push the changes to the git repository?" && \
27+
git add . && \
28+
git commit -m "Update package" && \
829
git push

0 commit comments

Comments
 (0)