[PR #130] Refactor bootstrap script #133

Open
opened 2026-05-06 13:13:32 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/bwya77/vscode-dark-islands/pull/130
Author: @marcus-miccelli
Created: 5/4/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (2)

  • 807ba39 Refactor bootstrap script for improved error handling and temporary directory management
  • c2cbfcb Fixed emoji echos

📊 Changes

1 file changed (+36 additions, -16 deletions)

View changed files

📝 bootstrap.ps1 (+36 -16)

📄 Description

Summary

This PR hardens bootstrap.ps1 so the Windows bootstrap installer handles common failure cases more reliably.

Issues

  • $InstallDir was assumed to exist or be created by git clone.
  • git clone failures were not reliably caught because native command failures do not always trigger try/catch in Windows PowerShell.
  • The script changed into $InstallDir, which could prevent cleanup from deleting the temp folder on Windows.
  • exit 1 could close the user’s current PowerShell session when run through irm ... | iex.
  • Running install.ps1 directly could be affected by PowerShell execution policy.
  • Cleanup errors could make an otherwise successful install appear failed.

Fixes

  • Creates a unique temp install directory before cloning.
  • Checks $LASTEXITCODE after git clone and the installer process.
  • Runs install.ps1 through a child PowerShell process with -ExecutionPolicy Bypass.
  • Uses return instead of exit 1 in bootstrap failure paths.
  • Avoids changing into the temp directory before running the installer.
  • Wraps temp cleanup in try/catch and reports when files are kept.
  • Normalised emoji echo strings to use regular quotes, avoiding issues from copied smart/backwards quotes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bwya77/vscode-dark-islands/pull/130 **Author:** [@marcus-miccelli](https://github.com/marcus-miccelli) **Created:** 5/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`807ba39`](https://github.com/bwya77/vscode-dark-islands/commit/807ba39f1dc894bdbca012022b43b35025200a8b) Refactor bootstrap script for improved error handling and temporary directory management - [`c2cbfcb`](https://github.com/bwya77/vscode-dark-islands/commit/c2cbfcb1a04f4d5a6b7f9cc82666f1745f01d2d0) Fixed emoji echos ### 📊 Changes **1 file changed** (+36 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `bootstrap.ps1` (+36 -16) </details> ### 📄 Description ## Summary This PR hardens `bootstrap.ps1` so the Windows bootstrap installer handles common failure cases more reliably. ## Issues - `$InstallDir` was assumed to exist or be created by `git clone`. - `git clone` failures were not reliably caught because native command failures do not always trigger `try/catch` in Windows PowerShell. - The script changed into `$InstallDir`, which could prevent cleanup from deleting the temp folder on Windows. - `exit 1` could close the user’s current PowerShell session when run through `irm ... | iex`. - Running `install.ps1` directly could be affected by PowerShell execution policy. - Cleanup errors could make an otherwise successful install appear failed. ## Fixes - Creates a unique temp install directory before cloning. - Checks `$LASTEXITCODE` after `git clone` and the installer process. - Runs `install.ps1` through a child PowerShell process with `-ExecutionPolicy Bypass`. - Uses `return` instead of `exit 1` in bootstrap failure paths. - Avoids changing into the temp directory before running the installer. - Wraps temp cleanup in `try/catch` and reports when files are kept. - Normalised emoji `echo` strings to use regular quotes, avoiding issues from copied smart/backwards quotes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vscode-dark-islands#133
No description provided.