Add option to configure extra command-line parameters propagated to composer

This commit is contained in:
Sander van der Burg 2021-02-26 22:36:18 +01:00 committed by Sander van der Burg
parent 441c34c4b0
commit 0c221a6cee

View file

@ -28,6 +28,7 @@ let
, removeComposerArtifacts ? false , removeComposerArtifacts ? false
, postInstall ? "" , postInstall ? ""
, noDev ? false , noDev ? false
, composerExtraArgs ? ""
, unpackPhase ? "true" , unpackPhase ? "true"
, buildPhase ? "true" , buildPhase ? "true"
, ...}@args: , ...}@args:
@ -185,10 +186,10 @@ let
# Reconstruct autoload scripts # Reconstruct autoload scripts
# We use the optimize feature because Nix packages cannot change after they have been built # We use the optimize feature because Nix packages cannot change after they have been built
# Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload. # Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload.
composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"} composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"} ${composerExtraArgs}
# Run the install step as a validation to confirm that everything works out as expected # Run the install step as a validation to confirm that everything works out as expected
composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"} composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"} ${composerExtraArgs}
${lib.optionalString executable '' ${lib.optionalString executable ''
# Reconstruct the bin/ folder if we deploy an executable project # Reconstruct the bin/ folder if we deploy an executable project