Skip to content

Commit 3cb0856

Browse files
authored
Merge pull request #5 from bashpack-project/working
Working
2 parents 9f82c56 + a2a67dc commit 3cb0856

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Bashpack is a **user-friendly Linux toolbox**.
44

5-
It has been designed for unexperimented Linux users for their **day to day tasks** and also for IT teams who needs to ensure security on their **Linux laptop** park.
5+
It has been designed for helping **Linux** users on their **day to day tasks**.
6+
It can also be useful for IT teams who needs to ensure security on their Linux park.
67

78
You can easily setup automations with the differents options.
89

bashpack.sh

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
URL="https://api.github.com/repos/bashpack-project/bashpack/tarball" # for Github tarball
2929
# URL="https://github.com/bashpack-project/bashpack/archive/refs/heads" # for Github main branch
3030

31-
VERSION="0.2.19"
31+
VERSION="0.2.20"
3232

3333
NAME="Bashpack"
3434
NAME_LOWERCASE=$(echo "$NAME" | tr A-Z a-z)
@@ -62,15 +62,18 @@ else
6262
&& echo "Options:" \
6363
&& echo " -y, --assume-yes enable automatic installations without asking during the execution." \
6464
&& echo " --ask ask to manually write your choice about updates installations confirmations." \
65+
&& echo " --get-logs display systemd logs." \
66+
&& echo " --when display systemd next service cycle." \
6567
&& echo "" \
6668
&& echo "" \
6769
&& exit ;;
68-
esac
70+
esac
6971
;;
7072
--help) echo "$USAGE" \
7173
&& echo "" \
7274
&& echo "$NAME is a user-friendly Linux toolbox." \
73-
&& echo "It has been designed for unexperimented Linux users and also for IT teams who needs to ensure security on their Linux laptop park." \
75+
&& echo "It has been designed for helping Linux users on their day to day tasks." \
76+
&& echo "It can also be useful for IT teams who needs to ensure security on their Linux park." \
7477
&& echo "You can easily setup automations with the differents options." \
7578
&& echo "" \
7679
&& echo "Features:" \
@@ -84,8 +87,6 @@ else
8487
&& echo " -i, --self-install install (or reinstall) $NAME on your system as the command '$NAME_ALIAS'." \
8588
&& echo " -u, --self-update update your current $NAME installation to the latest available version." \
8689
&& echo " --self-delete delete $NAME from your system." \
87-
&& echo " --get-logs display systemd logs." \
88-
&& echo " --when display systemd next service cycle." \
8990
&& echo " --help display this information." \
9091
&& echo " --version display version." \
9192
&& echo "" \
@@ -202,12 +203,21 @@ COMMAND_SYSTEMD_STATUS="systemctl status $file_systemd_update.timer"
202203
# Delete the installed command from the system
203204
delete_cli() {
204205

205-
local files=(
206-
$dir_src
207-
$file_autocompletion
208-
$file_main_alias
209-
$file_main
210-
)
206+
local exclude_main=${1}
207+
208+
if [[ $exclude_main = "exclude_main" ]]; then
209+
local files=(
210+
$dir_src
211+
$file_autocompletion
212+
)
213+
else
214+
local files=(
215+
$dir_src
216+
$file_autocompletion
217+
$file_main_alias
218+
$file_main
219+
)
220+
fi
211221

212222

213223
if [[ $(exists_command "$NAME_ALIAS") != "exists" ]]; then
@@ -285,7 +295,7 @@ delete_systemd() {
285295

286296
# Helper function to assemble all functions that delete something
287297
delete_all() {
288-
delete_systemd && delete_cli
298+
delete_systemd && delete_cli
289299
}
290300

291301

@@ -473,6 +483,9 @@ update_cli() {
473483
# # Delete current installed version to clean all old files
474484
# /!\ Deactivated for now because if we delete the last release from Github, the CLI is just beeing removed from the system...
475485
# delete_all
486+
delete_systemd && delete_cli exclude_main
487+
488+
echo ""
476489

477490
# Execute the install_cli function of the script downloaded in /tmp
478491
exec "$archive_dir_tmp/$NAME_LOWERCASE.sh" -i

0 commit comments

Comments
 (0)