diff --git a/stpkg b/stpkg
index a0c2f133c40ed3d81322e3047fed1d4d159a1df6..a074f174be3d8de06795bf65924efd74ca6d85b9 100755
--- a/stpkg
+++ b/stpkg
@@ -814,6 +814,7 @@ __pack() {
     find $DEST_FOLDER -type f \( ! -name "preview.png" -and ! -name "$PACK_NAME.json" \) -exec rm {} \;
 
     echo -n "]}" >> $DEST_INDEX
+    cat $DEST_INDEX | jq | sponge $DEST_INDEX
     info "Pack created, you can now commit it and create a MR to share it with other users"
 }