Skip to content

Commit

Permalink
doc: fix copy node executable in Windows
Browse files Browse the repository at this point in the history
Windows where command lists all places it finds a pattern in Path.
The first one is the one that executes when called.
So the old code was overriding the first executable by any other match.

PR-URL: #48624
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
yoavain authored and juanarbol committed Jul 13, 2023
1 parent 7daefae commit 999ae0c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions doc/api/single-executable-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,8 @@ tool, [postject][]:

* On Windows:

Using PowerShell:

```powershell
cp (Get-Command node).Source hello.exe
```

Using Command Prompt:

```text
for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe)
node -e "require('fs').copyFileSync(process.execPath, 'hello.exe')"
```

The `.exe` extension is necessary.
Expand Down

0 comments on commit 999ae0c

Please sign in to comment.