mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-14 07:12:19 +00:00
fix: optional arguments not working with create-one-time-access-token.sh
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
DB_PATH="./backend/data/pocket-id.db"
|
DB_PATH="./backend/data/pocket-id.db"
|
||||||
DB_PROVIDER="${DB_PROVIDER:=sqlite}"
|
DB_PROVIDER="${DB_PROVIDER:=sqlite}"
|
||||||
USER_IDENTIFIER="$1"
|
|
||||||
|
|
||||||
# Parse command-line arguments for the -d flag (database path)
|
# Parse command-line arguments for the -d flag (database path)
|
||||||
while getopts ":d:" opt; do
|
while getopts ":d:" opt; do
|
||||||
@@ -15,10 +14,12 @@ while getopts ":d:" opt; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Shift past the processed options
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
# Ensure username or email is provided as a parameter
|
# Ensure username or email is provided as a parameter
|
||||||
if [ -z "$1" ]; then
|
USER_IDENTIFIER="$1"
|
||||||
|
if [ -z "$USER_IDENTIFIER" ]; then
|
||||||
echo "Usage: $0 [-d <database_path>] <username or email>"
|
echo "Usage: $0 [-d <database_path>] <username or email>"
|
||||||
if [ "$DB_PROVIDER" == "sqlite" ]; then
|
if [ "$DB_PROVIDER" == "sqlite" ]; then
|
||||||
echo "-d <database_path> (optional): Path to the SQLite database file. Default: $DB_PATH"
|
echo "-d <database_path> (optional): Path to the SQLite database file. Default: $DB_PATH"
|
||||||
@@ -104,4 +105,4 @@ else
|
|||||||
echo "Error creating access token."
|
echo "Error creating access token."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "================================================="
|
echo "================================================="
|
||||||
Reference in New Issue
Block a user