Skip to content

Commit

Permalink
Update launch.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Oct 10, 2024
1 parent b4bd6e3 commit d924be7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { spawnProcess } from './utils/processes.js'
import { createServer } from './utils/server.js'

import * as mobile from './mobile/index.js'
import { run } from 'node:test';

const open = import('open').then(m => m.default)

Expand Down Expand Up @@ -95,8 +96,6 @@ export default async function (options: LaunchOptions) {

if (!fullPath) throw new Error(`This application has not been built for ${PLATFORM} yet.`)

console.log(`Launching application from ${fullPath}`)

let runExecutableCommand = "open" // Default to macOS command

const args = [
Expand All @@ -110,6 +109,8 @@ export default async function (options: LaunchOptions) {
else if (PLATFORM === 'linux') runExecutableCommand = args.shift() // Run executable directly on Linux
else if (PLATFORM === 'mac') args.splice(1, 0, "--args") // macOS-specific flag to pass additional arguments

console.log(`Launching application with ${_chalk.bold([runExecutableCommand, ...args].join(' '))}`)

await spawnProcess(runExecutableCommand, args, { env: process.env }); // Share the same environment variables

const debugUrl = `http://localhost:${electronDebugPort}`
Expand Down

0 comments on commit d924be7

Please sign in to comment.