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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Improved error handling when opening browser fails due to System Events permissions or non-standard browser configurations ([#178](https://github.com/MetaMask/create-release-branch/pull/178))
- Now provides clear manual URL instructions instead of failing with osascript errors
- Handles both cases: when terminal lacks System Events permissions and when using alternative browsers like Brave

## [4.1.1]
### Fixed
Expand Down
1 change: 0 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export async function main({
);

if (interactive) {
stdout.write(`Starting UI on port ${port}...\n`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed as redundant

await startUI({
project,
releaseType,
Expand Down
16 changes: 13 additions & 3 deletions src/ui.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { WriteStream } from 'fs';
import { join } from 'path';
import express from 'express';
import open, { apps } from 'open';
import open from 'open';

import {
restoreChangelogsForSkippedPackages,
Expand Down Expand Up @@ -86,8 +86,18 @@ export async function startUI({

const server = app.listen(port, async () => {
const url = `http://localhost:${port}`;
stdout.write(`UI server running at ${url}\n`);
open(url, { app: { name: apps.browser } });

try {
stdout.write(`\nAttempting to open UI in browser...`);
await open(url);
stdout.write(`\nUI server running at ${url}\n`);
} catch (error) {
stderr.write(`\n---------------------------------------------------\n`);
stderr.write(`Error automatically opening browser: ${error}\n`);
stderr.write(`Please open the following URL manually:\n`);
stderr.write(`${url}\n`);
stderr.write(`---------------------------------------------------\n\n`);
}
});

return new Promise((resolve, reject) => {
Expand Down
Loading