Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

> **Note**: odd version numbers, for example, `0.13.0`, are not included in this changelog. They are used to test the new features and fixes before the final release.

## [0.18.2] - 2025-03-03
## [0.18.3] - 2025-03-03

### Added:

Expand All @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Install: Fixed broken link for Linux
- Install: Updated brew tap command to reference new tap location
- Install: Fixed incorrect homebrew formulae name
- Commands: Fixed issue with stop command not waiting to ensure Dev Proxy process has fully stopped before disposing of terminal

## [0.16.0] - 2025-02-03

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dev-proxy-toolkit",
"displayName": "Dev Proxy Toolkit",
"description": "Makes it easy to create and update Dev Proxy configuration files.",
"version": "0.18.2",
"version": "0.18.3",
"publisher": "garrytrinder",
"engines": {
"vscode": "^1.89.0"
Expand Down
27 changes: 26 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const registerCommands = (context: vscode.ExtensionContext, configuration
vscode.commands.registerCommand('dev-proxy-toolkit.install', async (platform: NodeJS.Platform) => {
const versionPreference = configuration.get('version') as VersionPreference;
const message = vscode.window.setStatusBarMessage('Installing Dev Proxy...');

// we are on windows so we can use winget
if (platform === 'win32') {
const id = versionPreference === VersionPreference.Stable ? 'Microsoft.DevProxy' : 'Microsoft.DevProxy.Beta';
Expand All @@ -35,6 +35,14 @@ export const registerCommands = (context: vscode.ExtensionContext, configuration
// we are on macos so we can use brew
if (platform === 'darwin') {
const id = versionPreference === VersionPreference.Stable ? 'dev-proxy' : 'dev-proxy-beta';
// check if brew is installed
try {
await executeCommand('brew --version');
} catch (error) {
await vscode.window.showErrorMessage('Homebrew is not installed. Please install brew and try again.');
return;
}

try {
await executeCommand('brew tap dotnet/dev-proxy');
await executeCommand(`brew install ${id}`);
Expand Down Expand Up @@ -105,6 +113,23 @@ export const registerCommands = (context: vscode.ExtensionContext, configuration

const closeTerminal = configuration.get('closeTerminal') as boolean;
if (closeTerminal) {
const checkProxyStatus = async () => {
try {
const response = await fetch(`http://localhost:${apiPort}/proxy`);
return response.ok;
} catch {
return false;
}
};

let isRunning = true;
while (isRunning) {
isRunning = await checkProxyStatus();
if (isRunning) {
await new Promise(resolve => setTimeout(resolve, 1000));
}
}

vscode.window.terminals.forEach(terminal => {
if (terminal.name === 'Dev Proxy') {
terminal.dispose();
Expand Down