Skip to content

Commit 9debd7d

Browse files
committed
Run temporary directory cleanup in the background to prevent sluggish exit
- after showing 'Done!' we wait good 5 seconds what feels sluggish
1 parent 5ceb3a8 commit 9debd7d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎install.ps1‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,5 @@ if ($choice -eq 'a' -or $choice -eq 'A') {
102102
Write-Host "`nDone!"
103103

104104
Pop-Location
105-
Remove-Item -Recurse -Force $tmpDir
105+
# Run cleanup in the background to avoid sluggish exit
106+
Start-Process -FilePath "cmd.exe" -ArgumentList "/c", "rmdir", "/s", "/q", "`"$tmpDir`"" -WindowStyle Hidden

‎install.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ elif [[ "$choice" != "a" && "$choice" != "A" ]]; then
9797
fi
9898

9999
TMP_DIR=$(mktemp -d)
100-
trap 'rm -rf "$TMP_DIR"' EXIT
100+
trap '( rm -rf "$TMP_DIR" >/dev/null 2>&1 & )' EXIT
101101
echo ""
102102
echo "Cloning repository into temporary directory..."
103103
git clone -q --depth 1 https://github.com/robertpiosik/CodeWebChat.git "$TMP_DIR"

0 commit comments

Comments
 (0)