File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed
Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ main() {
6464 base_directory=$( dirname " ${scripts_directory} " )
6565 cd " ${base_directory} "
6666
67+ # Capture the current user and group ownership
68+ current_user=$( stat -c ' %U' .) || abort_update " Failed retrieving current user ownership."
69+ current_group=$( stat -c ' %G' .) || abort_update " Failed retrieving current group ownership."
70+
6771 colored_output " ${GREEN} " " Creating Python virtual environment \" ${base_directory} /.venv\" ..."
6872 python3.11 -m venv .venv || abort_install " Failed creating Python virtual environment."
6973
@@ -85,6 +89,8 @@ main() {
8589 systemctl enable bluetooth_2_usb.service || abort_install " Failed enabling service."
8690 systemctl start bluetooth_2_usb.service || abort_install " Failed starting service."
8791
92+ chown -R ${current_user} :${current_group} " ${base_directory} "
93+
8894 version=$( /usr/bin/bluetooth_2_usb -v)
8995 if [[ $version == * " Bluetooth 2 USB" * ]]; then
9096 colored_output " ${GREEN} " " Installation successful. Now running ${version} "
Original file line number Diff line number Diff line change 4040# Trap EXIT signal and call cleanup function
4141trap cleanup EXIT
4242
43- colored_output " ${GREEN} " " Updating Bluetooth 2 USB..."
44-
4543# Determine the current script's directory and the parent directory
4644scripts_directory=$( dirname $( readlink -f " $0 " ) )
4745base_directory=$( dirname " ${scripts_directory} " )
4846cd " ${base_directory} "
4947
48+ current_version=$( /usr/bin/bluetooth_2_usb -v)
49+ latest_vesion=$( git tag -l | sort -V | tail -n1)
50+ colored_output " ${GREEN} " " Updating ${current_version} -> ${latest_vesion} ..."
51+
5052# Capture the current user and group ownership and branch
5153current_user=$( stat -c ' %U' .) || abort_update " Failed retrieving current user ownership."
5254current_group=$( stat -c ' %G' .) || abort_update " Failed retrieving current group ownership."
5355current_branch=$( git symbolic-ref --short HEAD) || abort_update " Failed retrieving currently checked out branch."
5456
55- {
57+ {
5658 scripts/uninstall.sh &&
57- cd .. &&
58- rm -rf bluetooth_2_usb &&
59- git clone https://github.com/quaxalber/bluetooth_2_usb.git &&
60- chown -R ${current_user} :${current_group} bluetooth_2_usb &&
61- cd bluetooth_2_usb &&
62- git checkout " ${current_branch} "
63- scripts/install.sh &&
64- cd .. ;
59+ cd .. &&
60+ rm -rf " ${base_directory} " &&
61+ git clone https://github.com/quaxalber/bluetooth_2_usb.git &&
62+ cd " ${base_directory} " &&
63+ git checkout " ${current_branch} " &&
64+ chown -R ${current_user} :${current_group} " ${base_directory} " &&
65+ scripts/install.sh ;
6566} || abort_update " Failed updating Bluetooth 2 USB"
You can’t perform that action at this time.
0 commit comments