File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,
388388
389389 SeaConfig config = opt_config.value ();
390390 if (config.executable_path .empty ()) {
391- config.executable_path = args[ 0 ] ;
391+ config.executable_path = Environment::GetExecPath ( args) ;
392392 }
393393
394394 // Get file permissions from source executable to copy over later.
Original file line number Diff line number Diff line change 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 : / G e n e r a t e d s i n g l e e x e c u t a b l e / ,
34+ } ) ;
You can’t perform that action at this time.
0 commit comments