Skip to content
Extraits de code Groupes Projets
Valider 30468e0b rédigé par Kubat's avatar Kubat
Parcourir les fichiers

STPKG: Fix the edit ! (should be OK now)

Just in case: after an edit, the json in the exposed picker is not
updated, you may need to stpkg del && stpkg add it to take into account
the modifications.
parent ccbeb849
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -576,11 +576,11 @@ __edit() {
[ -z "$PACK_NAME" -o -z "$ACTION" -o -z "$STICKER_NAME" ] && die "Command argument are invalid, check the usage"
shift 3
local FILE="${STPKG_INSTALL}web/packs/$PACK_NAME.json"
[ ! -r "$FILE" ] && die "Can't read file '$FILE' associated to the '$PACK_NAME' pack"
local JSON_FILE="${STPKG_INSTALL}web/packs/$PACK_NAME.json"
[ ! -r "$JSON_FILE" ] && die "Can't read file '$JSON_FILE' associated to the '$PACK_NAME' pack"
local TEMP=`mktemp --suffix=.stpkg`
cp $FILE $TEMP
cp $JSON_FILE $TEMP
case "$ACTION" in
add)
......@@ -618,8 +618,10 @@ __edit() {
# TODO [OPTIONAL] Update the preview
# TODO Add a dry mode, to only preview the change
# TODO If the pack was already added to the picker, re-add it to take into
# account the modifications
#jq < $TEMP ### to test/review the change
cp $TEMP $FILE
cp $TEMP $JSON_FILE
}
__add() {
......
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