Compare commits
2 Commits
4dd63ca7a4
...
8640f56437
| Author | SHA1 | Date |
|---|---|---|
|
|
8640f56437 | |
|
|
8c7a3c68fd |
|
|
@ -57,21 +57,21 @@ EOF
|
|||
case "$1" in
|
||||
--cron) timer="cron $2"; shift 2 ;;
|
||||
--systemd) timer="systemd $2"; shift 2 ;;
|
||||
--dir) kind=dir; prefix="$(realpath "$2")"; shift 2 ;;
|
||||
--dir) kind=dir; prefix="$(realpath "$2" 2>/dev/null)" || prefix="$2"; shift 2 ;;
|
||||
--url) kind=url; prefix="$2"; shift 2 ;;
|
||||
--appid) kind=appid; prefix="$2"; shift 2 ;;
|
||||
*) usage; return 1 ;;
|
||||
esac
|
||||
done
|
||||
while [[ "$prefix" == /* ]]; do
|
||||
prefix="${prefix#/}"
|
||||
done
|
||||
if [[ -z "$prefix" || -z "$timer" ]]; then
|
||||
usage
|
||||
return 1
|
||||
fi
|
||||
while [[ "$prefix" == /* ]]; do
|
||||
prefix="${prefix#/}"
|
||||
done
|
||||
if [[ -n "${CWDCONTROL_SETTINGS["$kind /$prefix"]}" ]]; then
|
||||
echo "Warning: ${orig[*]} is a duplciate"
|
||||
echo "Warning: cwdcontrol-disallow ${orig[*]} is a duplciate"
|
||||
fi
|
||||
CWDCONTROL_SETTINGS["$kind /$prefix"]="$timer"
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue