Skip to content

Commit

Permalink
windows: use npx full path
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Feb 12, 2023
1 parent 91808be commit ddb6a3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker/install-scrypted-dependencies-win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ $SCRYPTED_HOME = $env:USERPROFILE + '\.scrypted'
$SCRYPTED_HOME_ESCAPED_PATH = $SCRYPTED_HOME.replace('\', '\\')
npm install --prefix $SCRYPTED_HOME node-windows@1.0.0-beta.8 --save

$NPX_PATH = (Get-Command npx).Path
$NPX_PATH_ESCAPED = $NPX_PATH.replace('\', '\\')

$SERVICE_JS = @"
const fs = require('fs');
try {
Expand All @@ -37,7 +40,7 @@ try {
catch (e) {
}
const child_process = require('child_process');
child_process.spawn('npx.cmd', ['-y', 'scrypted', 'serve'], {
child_process.spawn('$($NPX_PATH_ESCAPED)', ['-y', 'scrypted', 'serve'], {
stdio: 'inherit',
});
"@
Expand Down

0 comments on commit ddb6a3a

Please sign in to comment.