Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed pesky \r from getting into work array

  • Loading branch information...
commit 95604f35111952e5e3c8b3b0a6bfd306305f6b85 1 parent 5c375c5
graysky authored
Showing with 17 additions and 5 deletions.
  1. +17 −5 profile-cleaner
22 profile-cleaner
View
@@ -46,31 +46,43 @@ do_chrome() {
}
do_xulbased() {
+ # prepath should be defined in the do_whatever function
+ if [[ -h "$prepath" ]]; then
+ path=$(readlink $prepath)
+ else
+ path="$prepath"
+ fi
+
+ if [[ ! -d "$path" ]]; then
+ echo "Error: cannot locate $path"
+ exit 0
+ fi
+
if [[ ! -f $path/profiles.ini ]]; then
echo "Error: cannot locate $path/profiles.ini to determine names of profiles."
exit 0
fi
# read each profile into the work array
- work=( $(grep Path $path/profiles.ini | sed 's/Path=//') )
+ work=( $(grep Path $path/profiles.ini | sed -e 's/Path=//' -e 's/\r//') )
for i in "${work[@]}"; do
- find ${path} -maxdepth 2 -name '*.sqlite' -print0 | xargs -0 -n 1 -I {} bash -c "do_clean {} 2>/dev/null"
+ find ${path}/$i -maxdepth 2 -name '*.sqlite' -print0 | xargs -0 -n 1 -I {} bash -c "do_clean {} 2>/dev/null"
done
}
do_firefox() {
- path=$HOME/.mozilla/firefox
+ prepath=$HOME/.mozilla/firefox
do_xulbased
}
do_conkeror() {
- path=$HOME/.conkeror.mozdev.org/conkeror
+ prepath=$HOME/.conkeror.mozdev.org/conkeror
do_xulbased
}
do_thunderbird() {
- path=$HOME/.thunderbird
+ prepath=$HOME/.thunderbird
do_xulbased
}
Please sign in to comment.
Something went wrong with that request. Please try again.