mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
wp-cli: fix wrapper environment (#331050)
This commit is contained in:
commit
eed04f24d5
1 changed files with 9 additions and 6 deletions
|
@ -42,6 +42,9 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
||||
|
||||
# Usually --set-default is used to set default environment variables.
|
||||
# But the value is wrapped in single-quotes so our variables would be used literally instead
|
||||
# of the expanded version. Thus we use --run instead.
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
|
@ -50,12 +53,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
installShellCompletion --bash --name wp ${completion}
|
||||
|
||||
makeWrapper ${lib.getExe php} $out/bin/${finalAttrs.meta.mainProgram} \
|
||||
--set-default XDG_CACHE_HOME \$HOME/.cache \
|
||||
--set-default XDG_CONFIG_HOME \$HOME/.config \
|
||||
--set-default XDG_DATA_HOME \$HOME/.local/share \
|
||||
--set-default WP_CLI_CONFIG_PATH \$XDG_CONFIG_HOME}/wp-cli \
|
||||
--set-default WP_CLI_PACKAGES_DIR \$XDG_DATA_HOME/wp-cli \
|
||||
--set-default WP_CLI_CACHE_DIR \$XDG_CACHE_HOME/wp-cli \
|
||||
--run 'export XDG_CACHE_HOME=''${XDG_CACHE_HOME-"$HOME/.cache"}' \
|
||||
--run 'export XDG_CONFIG_HOME=''${XDG_CONFIG_HOME-"$HOME/.config"}' \
|
||||
--run 'export XDG_DATA_HOME=''${XDG_DATA_HOME-"$HOME/.local/share"}' \
|
||||
--run 'export WP_CLI_CONFIG_PATH=''${WP_CLI_CONFIG_PATH-"$XDG_CONFIG_HOME/wp-cli"}' \
|
||||
--run 'export WP_CLI_PACKAGES_DIR=''${WP_CLI_PACKAGES_DIR-"$XDG_DATA_HOME/wp-cli"}' \
|
||||
--run 'export WP_CLI_CACHE_DIR=''${WP_CLI_CACHE_DIR-"$XDG_CACHE_HOME/wp-cli"}' \
|
||||
--add-flags "-c $out/etc/${ini.name}" \
|
||||
--add-flags "-f $out/share/wp-cli/wp-cli.phar" \
|
||||
--add-flags "--"
|
||||
|
|
Loading…
Reference in a new issue