Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion src/node_sea_bin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,

SeaConfig config = opt_config.value();
if (config.executable_path.empty()) {
config.executable_path = args[0];
config.executable_path = Environment::GetExecPath(args);
}

// Get file permissions from source executable to copy over later.
Expand Down
26 changes: 26 additions & 0 deletions test/sea/test-build-sea-custom-argv0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';
// This tests --build-sea with a custom argv0 value.

require('../common');

const { skipIfBuildSEAIsNotSupported } = require('../common/sea');

skipIfBuildSEAIsNotSupported();

const { resolve } = require('path');
const fixtures = require('../common/fixtures');
const { rmSync } = require('fs');

const { spawnSyncAndAssert } = require('../common/child_process');
const fixturesDir = fixtures.path('sea', 'basic');

spawnSyncAndAssert(
process.execPath,
['--build-sea', resolve(fixturesDir, 'sea-config.json')], {
cwd: fixturesDir,
argv0: 'argv0',
}, {
stdout: /Generated single executable/,
});

rmSync(resolve(fixturesDir, 'sea'));
Loading