Skip to content
Extraits de code Groupes Projets
Valider 3f03fe12 rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Merge branch 'remove-python3-dep' into 'master'

Remove dep to python3 in favor of jq

See merge request !2
parents ab5c0199 1920f79a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!2Remove dep to python3 in favor of jq
...@@ -68,7 +68,7 @@ require() { ...@@ -68,7 +68,7 @@ require() {
done done
} }
require \ require \
md5sum mktemp column uuidgen convert montage identify python3 curl ffmpeg \ md5sum mktemp column uuidgen convert montage identify curl ffmpeg \
sed tr git sponge ls find jq chmod cat expr iconv bc sed tr git sponge ls find jq chmod cat expr iconv bc
__grep=`which egrep` __grep=`which egrep`
if [ -z $__grep ]; then if [ -z $__grep ]; then
...@@ -151,8 +151,7 @@ default_index() { ...@@ -151,8 +151,7 @@ default_index() {
} }
validate_token_internal() { validate_token_internal() {
curl -s -X POST "https://$STPKG_HOMESERV/_matrix/media/r0/upload?access_token=$STPKG_TOKEN" | \ curl -s -X POST "https://$STPKG_HOMESERV/_matrix/media/r0/upload?access_token=$STPKG_TOKEN" | jq -r ".errcode"
python3 -c "import sys, json; print(json.load(sys.stdin)['errcode'])" # TODO: Use jq here
} }
validate_token() { validate_token() {
...@@ -232,10 +231,9 @@ __upload_file() { ...@@ -232,10 +231,9 @@ __upload_file() {
validate_token # Validate token, will exit if invalid validate_token # Validate token, will exit if invalid
fi fi
# TODO: Use jq here
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 | python -c "import sys, json; print(json.load(sys.stdin)['content_uri'])") tee /tmp/toto | jq -r ".content_uri")
[ $? -ne 0 ] && die "Failed to upload sticker $NAME for pack $PACK_NAME to $STPKG_HOMESERV" [ $? -ne 0 ] && die "Failed to upload sticker $NAME for pack $PACK_NAME to $STPKG_HOMESERV"
} }
......
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