mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-03 23:43:40 +02:00
updater.sh add -l option
This commit is contained in:
parent
47e6741095
commit
5a2c110b13
1 changed files with 16 additions and 4 deletions
20
updater.sh
20
updater.sh
|
@ -40,9 +40,16 @@ set_wd () {
|
||||||
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
|
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
|
||||||
if [ -z "$sfp" ]; then sfp=${BASH_SOURCE[0]}; fi
|
if [ -z "$sfp" ]; then sfp=${BASH_SOURCE[0]}; fi
|
||||||
ff_profile="$(dirname "${sfp}")"
|
ff_profile="$(dirname "${sfp}")"
|
||||||
|
elif [ "$PROFILE_PATH" = "list" ]; then
|
||||||
|
echo -e ${GREEN}"The following profiles were found:\n"${ORANGE}
|
||||||
|
ls -d ~/Library/Application\ Support/Firefox/Profiles/*/
|
||||||
|
echo -e ${RED}"\nWhich profile would you like to update?"${NC}
|
||||||
|
read -p ""
|
||||||
|
echo -e ""
|
||||||
|
ff_profile=$(echo $REPLY | sed s'/.$//')
|
||||||
|
echo $ff_profile
|
||||||
else
|
else
|
||||||
ff_profile="$PROFILE_PATH"
|
ff_profile="$PROFILE_PATH"
|
||||||
echo "${sfp}"
|
|
||||||
fi
|
fi
|
||||||
cd "$ff_profile"
|
cd "$ff_profile"
|
||||||
}
|
}
|
||||||
|
@ -56,6 +63,8 @@ usage() {
|
||||||
echo -e "Optional Arguments:"
|
echo -e "Optional Arguments:"
|
||||||
echo -e "\t-h,\t\t Show this help message and exit."
|
echo -e "\t-h,\t\t Show this help message and exit."
|
||||||
echo -e "\t-p PROFILE,\t Path to your Firefox profile (if different than the dir of this script)"
|
echo -e "\t-p PROFILE,\t Path to your Firefox profile (if different than the dir of this script)"
|
||||||
|
echo -e "\t-l, \t\t Choose your Firefox profile from a list"
|
||||||
|
echo -e "\t\t\t Note: This will not work with portable Firefox installations."
|
||||||
echo -e "\t\t\t IMPORTANT: if the path include spaces, wrap the entire argument in quotes."
|
echo -e "\t\t\t IMPORTANT: if the path include spaces, wrap the entire argument in quotes."
|
||||||
echo -e "\t-u,\t\t Update updater.sh and execute silently. Do not seek confirmation."
|
echo -e "\t-u,\t\t Update updater.sh and execute silently. Do not seek confirmation."
|
||||||
echo -e "\t-d,\t\t Do not look for updates to updater.sh."
|
echo -e "\t-d,\t\t Do not look for updates to updater.sh."
|
||||||
|
@ -320,14 +329,17 @@ if [ $# != 0 ]; then
|
||||||
UPDATE="yes"
|
UPDATE="yes"
|
||||||
legacy_argument $1
|
legacy_argument $1
|
||||||
else
|
else
|
||||||
while getopts ":hp:udsno:bcvr" opt; do
|
while getopts ":hp:ludsno:bcvr" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h)
|
h)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
p)
|
p)
|
||||||
PROFILE_PATH=${OPTARG}
|
PROFILE_PATH=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
l)
|
||||||
|
PROFILE_PATH="list"
|
||||||
|
;;
|
||||||
u)
|
u)
|
||||||
UPDATE="yes"
|
UPDATE="yes"
|
||||||
;;
|
;;
|
||||||
|
@ -375,8 +387,8 @@ fi
|
||||||
|
|
||||||
## change directory to the Firefox profile directory
|
## change directory to the Firefox profile directory
|
||||||
|
|
||||||
set_wd
|
|
||||||
initiate
|
initiate
|
||||||
|
set_wd
|
||||||
update_updater
|
update_updater
|
||||||
confirmation && update_userjs
|
confirmation && update_userjs
|
||||||
create_diff
|
create_diff
|
||||||
|
|
Loading…
Add table
Reference in a new issue