Skip to content

Commit 38e3827

Browse files
authored
Fix backstage.json overriding in the case of the backstage workspace. (#104)
1 parent 2d79677 commit 38e3827

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

export-dynamic/export-dynamic.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ else
7878
if [[ -f "${workspaceOverlayFolder}/backstage.json" ]]
7979
then
8080
echo "Overriding backstage.json file before exporting plugins to override the supportedVersions package field."
81-
cp -fv "backstage.json" "backstage.json.save"
81+
if [[ -f "backstage.json" ]]
82+
then
83+
cp -fv "backstage.json" "backstage.json.save"
84+
trap "mv -fv 'backstage.json.save' 'backstage.json'" EXIT
85+
fi
8286
cp -fv "${workspaceOverlayFolder}/backstage.json" "backstage.json"
83-
trap "mv -fv 'backstage.json.save' 'backstage.json'" EXIT
8487
fi
8588

8689
# We use '|| [[ -n "$plugin" ]]' to catch the last line even if it lacks a newline.

0 commit comments

Comments
 (0)