Unverified Commit 1049aef0 authored by Paul Nicholson's avatar Paul Nicholson Committed by GitHub
Browse files

doppler: fix build failure with shell completion (#326008)

Sets the HOME environment variable to a temporary dir, as the cli attempts to run a setup routine which creates a directory under the user's home

Fixes #325915

also fix cross-compilation
parent 0dec852e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
, installShellFiles
, lib
, testers
, stdenv
}:

buildGoModule rec {
@@ -28,6 +29,9 @@ buildGoModule rec {

  postInstall = ''
    mv $out/bin/cli $out/bin/doppler
  '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
    export HOME=$TMPDIR
    mkdir $HOME/.doppler # to avoid race conditions below
    installShellCompletion --cmd doppler \
      --bash <($out/bin/doppler completion bash) \
      --fish <($out/bin/doppler completion fish) \