This commit is contained in:
Jason Ertel
2024-11-01 16:29:04 -04:00
parent c9f6b5206a
commit 25479ca71f

View File

@@ -64,6 +64,9 @@ fi
operation=$1 operation=$1
shift shift
searchUsername=__MISSING__
note=__MISSING__
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
param=$1 param=$1
shift shift
@@ -89,8 +92,8 @@ while [[ $# -gt 0 ]]; do
shift shift
;; ;;
--searchusername) --searchusername)
searchusername=$1 searchUsername=$1
[[ ${#searchusername} -gt 50 ]] && fail "search username cannot be longer than 50 characters" [[ ${#searchUsername} -gt 50 ]] && fail "search username cannot be longer than 50 characters"
shift shift
;; ;;
--json) --json)
@@ -260,6 +263,7 @@ function update() {
clientId=$1 clientId=$1
name=$2 name=$2
note=$3 note=$3
username=$4
body=$(cat <<EOF body=$(cat <<EOF
[ [
@@ -273,7 +277,7 @@ function update() {
"path": "/metadata", "path": "/metadata",
"value": { "value": {
"note": "$note", "note": "$note",
"searchUsername": "$searchusername" "searchUsername": "$username"
} }
} }
] ]
@@ -370,8 +374,8 @@ case "${operation}" in
verifyEnvironment verifyEnvironment
[[ "$id" == "" ]] && fail "Id must be provided" [[ "$id" == "" ]] && fail "Id must be provided"
[[ "$name" == "" ]] && fail "Name must be provided" [[ "$name" == "" ]] && fail "Name must be provided"
[[ "$note" == "" ]] && fail "Note must be provided" [[ "$note" == "__MISSING__" ]] && fail "Note must be provided"
[[ "$searchusername" == "" ]] && fail "Search Username must be provided" [[ "$searchusername" == "__MISSING__" ]] && fail "Search Username must be provided"
lock lock
update "$id" "$name" "$note" "$searchusername" update "$id" "$name" "$note" "$searchusername"