1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

vscode: simplify helper scripts

This simplifies the following commit.

- Remove `--` from `rm` because `$tmpDir` is guaranteed to never start
  with a `-`.
  We also don't use this pattern when removing tmpDirs at other places
  in nixpkgs.
- Remove `unset tmpDir` because the variable `tmpDir` is never
  accessed after the exit handler is run.
This commit is contained in:
Erik Arvstedt 2022-07-02 16:12:16 +02:00
parent 958c79dc11
commit bb7867f1e5
No known key found for this signature in database
GPG key ID: 33312B944DD97846
2 changed files with 3 additions and 6 deletions

View file

@ -37,9 +37,8 @@ prefetchExtensionUnpacked() {
1>&2 echo "zipStorePath='$zipStorePath'"
function rm_tmpdir() {
1>&2 printf "rm -rf -- %q\n" "$tmpDir"
rm -rf -- "$tmpDir"
unset tmpDir
1>&2 printf "rm -rf %q\n" "$tmpDir"
rm -rf "$tmpDir"
trap - INT TERM HUP EXIT
}
function make_trapped_tmpdir() {

View file

@ -44,9 +44,7 @@ extStoreName="${extPublisher}-${extName}"
function rm_tmpdir() {
#echo "Removing \`tmpDir='$tmpDir'\`"
rm -rf -- "$tmpDir"
unset tmpDir
rm -rf "$tmpDir"
trap - INT TERM HUP EXIT
}
function make_trapped_tmpdir() {