php: cleanup translators

This commit is contained in:
Martin Toman 2022-09-19 14:25:37 -07:00
parent 056ef41742
commit 7a2ff69fb3
2 changed files with 6 additions and 7 deletions

View File

@ -56,15 +56,12 @@
# create lockfile # create lockfile
if [ "$(jq '.project.subsystemInfo.noDev' -c -r $jsonInput)" == "true" ]; then if [ "$(jq '.project.subsystemInfo.noDev' -c -r $jsonInput)" == "true" ]; then
echo "excluding dev dependencies" echo "excluding dev dependencies"
jq '.require-dev = {}' ./composer.json > composer.json.mod mv composer.json composer.json.orig
mv composer.json.mod composer.json jq '.require-dev = {}' ./composer.json.orig > composer.json
composer update --ignore-platform-reqs --no-scripts --no-plugins --no-install --no-dev
else
composer update --ignore-platform-reqs --no-scripts --no-plugins --no-install
fi fi
composer update --ignore-platform-reqs --no-scripts --no-plugins --no-install
jq ".source = \"$newSource\"" -c -r $jsonInput > $TMPDIR/newJsonInput jq ".source = \"$newSource\"" -c -r $jsonInput > $TMPDIR/newJsonInput
popd popd
${subsystems.php.translators.composer-lock.translateBin} $TMPDIR/newJsonInput ${subsystems.php.translators.composer-lock.translateBin} $TMPDIR/newJsonInput
''; '';

View File

@ -68,10 +68,12 @@
popd popd
if [ -e $TMPDIR/source/composer.lock ] if [ -f $TMPDIR/source/composer.lock ]
then then
echo 'Translating with composer-lock'
${subsystems.php.translators.composer-lock.translateBin} $TMPDIR/newJsonInput ${subsystems.php.translators.composer-lock.translateBin} $TMPDIR/newJsonInput
else else
echo 'Translating with composer-json'
${subsystems.php.translators.composer-json.translateBin} $TMPDIR/newJsonInput ${subsystems.php.translators.composer-json.translateBin} $TMPDIR/newJsonInput
fi fi