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:
parent
958c79dc11
commit
bb7867f1e5
|
@ -37,9 +37,8 @@ prefetchExtensionUnpacked() {
|
||||||
1>&2 echo "zipStorePath='$zipStorePath'"
|
1>&2 echo "zipStorePath='$zipStorePath'"
|
||||||
|
|
||||||
function rm_tmpdir() {
|
function rm_tmpdir() {
|
||||||
1>&2 printf "rm -rf -- %q\n" "$tmpDir"
|
1>&2 printf "rm -rf %q\n" "$tmpDir"
|
||||||
rm -rf -- "$tmpDir"
|
rm -rf "$tmpDir"
|
||||||
unset tmpDir
|
|
||||||
trap - INT TERM HUP EXIT
|
trap - INT TERM HUP EXIT
|
||||||
}
|
}
|
||||||
function make_trapped_tmpdir() {
|
function make_trapped_tmpdir() {
|
||||||
|
|
|
@ -44,9 +44,7 @@ extStoreName="${extPublisher}-${extName}"
|
||||||
|
|
||||||
|
|
||||||
function rm_tmpdir() {
|
function rm_tmpdir() {
|
||||||
#echo "Removing \`tmpDir='$tmpDir'\`"
|
rm -rf "$tmpDir"
|
||||||
rm -rf -- "$tmpDir"
|
|
||||||
unset tmpDir
|
|
||||||
trap - INT TERM HUP EXIT
|
trap - INT TERM HUP EXIT
|
||||||
}
|
}
|
||||||
function make_trapped_tmpdir() {
|
function make_trapped_tmpdir() {
|
||||||
|
|
Loading…
Reference in a new issue