-
Notifications
You must be signed in to change notification settings - Fork 724
feat: add run from ASAR button #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
3b25345
7fe1b21
eee6ea4
177b402
4126b85
15a7597
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,11 +20,16 @@ export enum ForgeCommands { | |||||||||||||
MAKE = 'make', | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
interface runOptions { | ||||||||||||||
runFromAsar: boolean; | ||||||||||||||
} | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Should start with a capital letter to match existing style, and should be exported since it's part of the public API for this file. Since these are options, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, missed the capital letter there, thanks for catching that! |
||||||||||||||
|
||||||||||||||
interface RunFiddleParams { | ||||||||||||||
localPath: string | undefined; | ||||||||||||||
isValidBuild: boolean; // If the localPath is a valid Electron build | ||||||||||||||
version: string; // The user selected version | ||||||||||||||
dir: string; | ||||||||||||||
runFromAsar: boolean; | ||||||||||||||
AlokYadavCodes marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
} | ||||||||||||||
|
||||||||||||||
const resultString: Record<RunResult, string> = Object.freeze({ | ||||||||||||||
|
@@ -139,8 +144,9 @@ export class Runner { | |||||||||||||
/** | ||||||||||||||
* Actually run the fiddle. | ||||||||||||||
*/ | ||||||||||||||
public async run(): Promise<RunResult> { | ||||||||||||||
public async run(runOptions?: runOptions): Promise<RunResult> { | ||||||||||||||
const options = { includeDependencies: false, includeElectron: false }; | ||||||||||||||
const runFromAsar = runOptions?.runFromAsar ?? false; | ||||||||||||||
|
||||||||||||||
const { appState } = this; | ||||||||||||||
const currentRunnable = appState.currentElectronVersion; | ||||||||||||||
|
@@ -220,6 +226,7 @@ export class Runner { | |||||||||||||
isValidBuild, | ||||||||||||||
dir, | ||||||||||||||
version, | ||||||||||||||
runFromAsar, | ||||||||||||||
}); | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
|
@@ -362,12 +369,15 @@ export class Runner { | |||||||||||||
* or the user selected electron version | ||||||||||||||
*/ | ||||||||||||||
private async runFiddle(params: RunFiddleParams): Promise<RunResult> { | ||||||||||||||
const { version, dir } = params; | ||||||||||||||
const { version, dir, runFromAsar } = params; | ||||||||||||||
const { pushOutput, flushOutput, executionFlags } = this.appState; | ||||||||||||||
const env = this.buildChildEnvVars(); | ||||||||||||||
|
||||||||||||||
// Add user-specified cli flags if any have been set. | ||||||||||||||
const options = [dir, '--inspect'].concat(executionFlags); | ||||||||||||||
if (runFromAsar) { | ||||||||||||||
options.push('runFromAsar'); | ||||||||||||||
} | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be added to |
||||||||||||||
|
||||||||||||||
const cleanup = async () => { | ||||||||||||||
flushOutput(); | ||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.