We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
--build-sea
1 parent bb82b44 commit 62b0758Copy full SHA for 62b0758
2 files changed
src/node_sea_bin.cc
@@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,
388
389
SeaConfig config = opt_config.value();
390
if (config.executable_path.empty()) {
391
- config.executable_path = args[0];
+ config.executable_path = Environment::GetExecPath(args);
392
}
393
394
// Get file permissions from source executable to copy over later.
test/sea/test-build-sea-custom-argv0.js
@@ -0,0 +1,34 @@
1
+'use strict';
2
+// This tests --build-sea with a custom argv0 value.
3
+
4
+require('../common');
5
6
+const { skipIfBuildSEAIsNotSupported } = require('../common/sea');
7
8
+skipIfBuildSEAIsNotSupported();
9
10
+const tmpdir = require('../common/tmpdir');
11
+const fixtures = require('../common/fixtures');
12
+const { copyFileSync } = require('fs');
13
14
+const { spawnSyncAndAssert } = require('../common/child_process');
15
+tmpdir.refresh();
16
17
+copyFileSync(
18
+ fixtures.path('sea', 'basic', 'sea-config.json'),
19
+ tmpdir.resolve('sea-config.json'),
20
+);
21
22
23
+ fixtures.path('sea', 'basic', 'sea.js'),
24
+ tmpdir.resolve('sea.js'),
25
26
27
+spawnSyncAndAssert(
28
+ process.execPath,
29
+ ['--build-sea', tmpdir.resolve('sea-config.json')], {
30
+ cwd: tmpdir.path,
31
+ argv0: 'argv0',
32
+ }, {
33
+ stdout: /Generated single executable/,
34
+ });
0 commit comments