镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Merged
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
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
34 changes: 34 additions & 0 deletions test/sea/test-build-sea-custom-argv0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';
// This tests --build-sea with a custom argv0 value.

require('../common');

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

skipIfBuildSEAIsNotSupported();

const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const { copyFileSync } = require('fs');

const { spawnSyncAndAssert } = require('../common/child_process');
tmpdir.refresh();

copyFileSync(
fixtures.path('sea', 'basic', 'sea-config.json'),
tmpdir.resolve('sea-config.json'),
);

copyFileSync(
fixtures.path('sea', 'basic', 'sea.js'),
tmpdir.resolve('sea.js'),
);

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