diff options
author | Elis Hirwing <elis@hirwing.se> | 2023-08-09 21:25:01 +0200 |
---|---|---|
committer | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-09-13 15:00:04 +0200 |
commit | 1e238b8afef29aa559b3380b240eeeb2908862ea (patch) | |
tree | 02f2c83fbdb1a574fc56cf4b4c04895363568ccc /pkgs/build-support/php/hooks | |
parent | 2160ed2bccc361c43e841e16b742cdda07f64461 (diff) |
php: Fix shellcheck string warnings in composer-install-hook
Diffstat (limited to 'pkgs/build-support/php/hooks')
-rw-r--r-- | pkgs/build-support/php/hooks/composer-install-hook.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkgs/build-support/php/hooks/composer-install-hook.sh b/pkgs/build-support/php/hooks/composer-install-hook.sh index 139f6357c5d79..2d5c90ea3b2fa 100644 --- a/pkgs/build-support/php/hooks/composer-install-hook.sh +++ b/pkgs/build-support/php/hooks/composer-install-hook.sh @@ -16,7 +16,7 @@ composerInstallConfigureHook() { fi if [[ -e "$composerLock" ]]; then - cp $composerLock composer.lock + cp "$composerLock" composer.lock fi if [[ ! -f "composer.lock" ]]; then @@ -39,7 +39,7 @@ composerInstallBuildHook() { # Since this file cannot be generated in the composer-repository-hook.sh # because the file contains hardcoded nix store paths, we generate it here. - composer-local-repo-plugin --no-ansi build-local-repo -p ${composerRepository} > packages.json + composer-local-repo-plugin --no-ansi build-local-repo -p "${composerRepository}" > packages.json # Remove all the repositories of type "composer" # from the composer.json file. @@ -48,7 +48,7 @@ composerInstallBuildHook() { # Configure composer to disable packagist and avoid using the network. composer config repo.packagist false # Configure composer to use the local repository. - composer config repo.composer composer file://$PWD/packages.json + composer config repo.composer composer file://"$PWD"/packages.json # Since the composer.json file has been modified in the previous step, the # composer.lock file needs to be updated. @@ -96,13 +96,13 @@ composerInstallInstallHook() { rm packages.json # Copy the relevant files only in the store. - mkdir -p $out/share/php/${pname} - cp -r . $out/share/php/${pname}/ + mkdir -p "$out"/share/php/"${pname}" + cp -r . "$out"/share/php/"${pname}"/ # Create symlinks for the binaries. - jq -r -c 'try .bin[]' composer.json | while read bin; do - mkdir -p $out/share/php/${pname} $out/bin - ln -s $out/share/php/${pname}/$bin $out/bin/$(basename $bin) + jq -r -c 'try .bin[]' composer.json | while read -r bin; do + mkdir -p "$out"/share/php/"${pname}" "$out"/bin + ln -s "$out"/share/php/"${pname}"/"$bin" "$out"/bin/"$(basename "$bin")" done echo "Finished composerInstallInstallHook" |