Skip to content
Extraits de code Groupes Projets
Vérifiée Valider e801ec0e rédigé par Elliu's avatar Elliu Validation de salixor
Parcourir les fichiers

Ask for the matrix token earlier if it's not in conf

parent f9d211a1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -226,11 +226,6 @@ __upload_file() { ...@@ -226,11 +226,6 @@ __upload_file() {
local FILE=$2 # The file local FILE=$2 # The file
local NAME=$3 # The pretty name for the sticker local NAME=$3 # The pretty name for the sticker
if [ "x$STPKG_TOKEN" = "x" ]; then
read -sp "`__yellow 'Enter your access token:'`" STPKG_TOKEN
validate_token # Validate token, will exit if invalid
fi
MXC=$(curl -s -X POST -H \ MXC=$(curl -s -X POST -H \
"Content-Type: $TYPE" --data-binary "@$FILE" "https://$STPKG_HOMESERV/_matrix/media/r0/upload?access_token=$STPKG_TOKEN" | \ "Content-Type: $TYPE" --data-binary "@$FILE" "https://$STPKG_HOMESERV/_matrix/media/r0/upload?access_token=$STPKG_TOKEN" | \
tee /tmp/toto | jq -r ".content_uri") tee /tmp/toto | jq -r ".content_uri")
...@@ -602,6 +597,11 @@ process_sticker_file() { ...@@ -602,6 +597,11 @@ process_sticker_file() {
FILE="$1" FILE="$1"
local -n JSON_REF="$2" local -n JSON_REF="$2"
if [ "x$STPKG_TOKEN" = "x" ]; then
read -sp "`__yellow 'Enter your access token:'`" STPKG_TOKEN
validate_token # Validate token, will exit if invalid
fi
# Get the names and extensions # Get the names and extensions
local INIT_TYPE=$(file_get_type "$FILE") local INIT_TYPE=$(file_get_type "$FILE")
local INIT_EXT=$(file_get_ext_from_type "$INIT_TYPE") local INIT_EXT=$(file_get_ext_from_type "$INIT_TYPE")
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter