| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path, | |||
| 388 | 388 | ||
| 389 | 389 | SeaConfig config = opt_config.value(); | |
| 390 | 390 | if (config.executable_path.empty()) { | |
| 391 | - config.executable_path = args[0]; | ||
| 391 | + config.executable_path = Environment::GetExecPath(args); | ||
| 392 | 392 | } | |
| 393 | 393 | ||
| 394 | 394 | // Get file permissions from source executable to copy over later. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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 | + copyFileSync( | ||
| 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 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments