Fix trailing whitespace preventing package match

This commit is contained in:
Juno Takano 2024-07-14 07:16:02 -03:00
parent cae379cbcb
commit e95eefe666
3 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,5 @@
0.4.1 2024-07-14: Fixes "Cancel" option not exiting on package resolution
Fixes whitespace preventing package list matches on "remove all"
0.4.0 2024-07-14: "Add/remove all from configuration" resolution strategy
0.3.1 2024-07-13: Refactor, new docs page, make cache refresh lazier
0.3.0 2024-07-11: "Enter packages to install/uninstall" resolution strategy

View file

@ -9,7 +9,10 @@ track_packages() {
untrack_packages() {
local packages="$1"
log debug "[untrack_packages] Removing packages: $packages"
echo "$packages" | xargs | sed 's/ /\n/g' | while read -r package; do
sed -i '' "/^$package$/d" "$CONFIG_ROOT/packages"
sed -i '' "/^[[:space:]]*$package[[:space:]]*$/d" "$CONFIG_ROOT/packages"
log debug "[untrack_packages] Executed removal for $package with exit code $?"
done
}

2
tori
View file

@ -2,7 +2,7 @@
main() {
# paths
VERSION="0.4.0 2024-07-14"
VERSION="0.4.1 2024-07-14"
TORI_ROOT="$HOME/.local/share/tori"
CONFIG_ROOT="$HOME/.config/tori"
TMP_DIR="/tmp/tori"