-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
fix(node): Electron apps crashing #367
Conversation
Inside a `app.asar` file, the package.json might get trimmed and the `bugs_url` might be missing `repo_url` conditional check was added for good measure
hotfix would be nice :) (btw there is a commit message, so might be better not to squash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some tests and it's safe to assume homepage
is always there from what I see. So to avoid hard coding stuff I suggest something like this:
//...
const package_json = JSON.parse(readFileSync(path.resolve(__dirname__, is_cjs ? '../package.json' : '../../package.json'), 'utf-8'));
const repo_url = package_json.homepage.split('#')[0];
//...
Platform.load({
runtime: 'node',
info: {
version: package_json.version,
bugs_url: package_json.bugs?.url || `${repo_url}/issues`,
repo_url
}
//...
});
Done, I did also add a ? to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Looks good.
Also, there will be a release today but first I'll review #366.
Thank you for reporting & helping fix this issue!
@LuanRT can you please add this to the bottom of this pull request's body, so that release please adds it to the changelog (the title and commit message are missing a
see #351 for an example |
thanks, release please will pick up the override next time it runs, so when the next/another pull request is merged |
fix(node) Electron apps crashing
Description
Inside a
app.asar
file, the package.json might get trimmed and thebugs_url
might be missingrepo_url
conditional check was added for good measureFixes #365
Type of change
Checklist:
BEGIN_COMMIT_OVERRIDE
fix(node): Electron apps crashing (#367)
END_COMMIT_OVERRIDE