arduino-cli: avoid creating temp files for completions

We still need to set HOME or we get

Error: invalid path creating config dir: /homeless-shelter/.arduino15 error: mkdir /homeless-shelter: permission denied
This commit is contained in:
Stefan Frijters 2024-03-11 12:26:26 +01:00
parent 663096a9dc
commit 20fa19a8b4
No known key found for this signature in database
GPG key ID: 7619A6BC6E7DFA6F

View file

@ -55,10 +55,10 @@ let
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export HOME="$(mktemp -d)"
for s in {bash,zsh,fish}; do
$out/bin/arduino-cli completion $s > completion.$s
installShellCompletion --cmd arduino-cli --$s completion.$s
done
installShellCompletion --cmd arduino-cli \
--bash <($out/bin/arduino-cli completion bash) \
--zsh <($out/bin/arduino-cli completion zsh) \
--fish <($out/bin/arduino-cli completion fish)
unset HOME
'';