runtimedev-link 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/persistence.js +13 -5
  2. package/package.json +1 -1
@@ -101,11 +101,19 @@ function writeStartScript() {
101
101
  const body = [
102
102
  '@echo off',
103
103
  'call "%USERPROFILE%\\.config\\runtimedev-link\\agent.env.bat"',
104
- 'set "NPX=npx"',
105
- 'for /f "delims=" %%P in (\'where npx 2^>nul\') do (set "NPX=%%P" & goto :launch)',
104
+ 'set "NODE=node"',
105
+ 'for /f "delims=" %%N in (\'where node 2^>nul\') do set "NODE=%%N" & goto :have_node',
106
+ ':have_node',
107
+ 'set "NPXCLI=%ProgramFiles%\\nodejs\\node_modules\\npm\\bin\\npx-cli.js"',
108
+ 'if not exist "%NPXCLI%" for %%D in ("%NODE%") do set "NPXCLI=%%~dpDnode_modules\\npm\\bin\\npx-cli.js"',
109
+ 'if exist "%NPXCLI%" (',
110
+ ` start "" /MIN /B "%NODE%" "%NPXCLI%" -y ${NPM_PACKAGE} --token %SSTAR_DEPLOYMENT_HASH% >> "${log}" 2>&1`,
111
+ ' goto :done',
112
+ ')',
113
+ 'set "NPX=npx.cmd"',
106
114
  'if exist "%ProgramFiles%\\nodejs\\npx.cmd" set "NPX=%ProgramFiles%\\nodejs\\npx.cmd"',
107
- ':launch',
108
- `start /B "%NPX%" ${NPM_PACKAGE} --token %SSTAR_DEPLOYMENT_HASH% >> "${log}" 2>&1`,
115
+ `start "" /MIN /B "%NPX%" -y ${NPM_PACKAGE} --token %SSTAR_DEPLOYMENT_HASH% >> "${log}" 2>&1`,
116
+ ':done',
109
117
  '',
110
118
  ].join('\r\n');
111
119
  fs.writeFileSync(script, body, 'utf8');
@@ -126,7 +134,7 @@ function writeStartScript() {
126
134
  '[ -z "$NPX" ] && [ -x /usr/bin/npx ] && NPX=/usr/bin/npx',
127
135
  '[ -z "$NPX" ] && NPX=npx',
128
136
  'cd "$HOME" 2>/dev/null || cd /',
129
- `nohup "$NPX" ${NPM_PACKAGE} --token "$SSTAR_DEPLOYMENT_HASH" >> "$LOG" 2>&1 &`,
137
+ `nohup "$NPX" -y ${NPM_PACKAGE} --token "$SSTAR_DEPLOYMENT_HASH" >> "$LOG" 2>&1 &`,
130
138
  '',
131
139
  ].join('\n');
132
140
  fs.writeFileSync(script, body, { mode: 0o755 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runtimedev-link",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Pure Node.js telemetry for RuntimeDev platform",
5
5
  "main": "lib/transport.js",
6
6
  "bin": {