Skip to content
Open
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
1 change: 1 addition & 0 deletions src/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = function getDefaultsFromPackageJSON (pkg, fallbacks = {}) {
return {
arch: undefined,
bin: pkg.name || 'electron',
binName: pkg.name || 'electron',
execArguments: [],
categories: [
'GNOME',
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type CatchableFunction = (err: Error) => void;
export type Configuration = {
arch?: string;
bin?: string;
binName?: string;
categories?: string[];
description?: string;
execArguments?: string[];
Expand Down
2 changes: 1 addition & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class ElectronInstaller {
*/
async createBinarySymlink () {
const binSrc = path.join('../lib', this.appIdentifier, this.options.bin)
const binDest = path.join(this.stagingDir, this.baseAppDir, 'bin', this.appIdentifier)
const binDest = path.join(this.stagingDir, this.baseAppDir, 'bin', this.options.binName)
debug(`Symlinking binary from ${binSrc} to ${binDest}`)

const bundledBin = path.join(this.sourceDir, this.options.bin)
Expand Down
1 change: 1 addition & 0 deletions test/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ test('empty package.json', t => {
t.deepEqual(getDefaultsFromPackageJSON({}), {
arch: undefined,
bin: 'electron',
binName: 'electron',
execArguments: [],
categories: [
'GNOME',
Expand Down
4 changes: 3 additions & 1 deletion test/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ test('copyLinuxIcons does nothing if icon option not specified', async t => {
test('createBinarySymlink creates symlink when bin exists', async t => {
const options = {
bin: 'app-name',
binName: 'start_app',
logger: log => log,
name: 'bundled_app',
src: path.join(__dirname, 'fixtures', 'bundled_app')
Expand All @@ -96,13 +97,14 @@ test('createBinarySymlink creates symlink when bin exists', async t => {
installer.generateOptions()
await installer.createStagingDir()
await installer.createBinarySymlink()
const stats = await fs.lstat(path.join(installer.stagingDir, installer.baseAppDir, 'bin', 'bundled_app'))
const stats = await fs.lstat(path.join(installer.stagingDir, installer.baseAppDir, 'bin', 'start_app'))
t.true(stats.isSymbolicLink())
})

test('createBinarySymlink does not create symlink when bin does not exist', async t => {
const options = {
bin: 'nonexistent',
binName: 'bundled_app',
logger: log => log,
name: 'bundled_app',
src: path.join(__dirname, 'fixtures', 'bundled_app')
Expand Down