kangentic 0.2.0 → 0.3.1
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.
- package/bin/kangentic.js +11 -5
- package/package.json +1 -1
package/bin/kangentic.js
CHANGED
|
@@ -268,21 +268,27 @@ function launch(platformInfo, targetDir, dataDir) {
|
|
|
268
268
|
childEnv.KANGENTIC_DATA_DIR = dataDir;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
const launchArgs = targetDir ? [`--cwd=${targetDir}`] : [];
|
|
272
|
+
|
|
271
273
|
if (platformInfo.platform === 'win32') {
|
|
272
|
-
const child = spawn(installPath,
|
|
274
|
+
const child = spawn(installPath, launchArgs, {
|
|
273
275
|
detached: true,
|
|
274
276
|
stdio: 'ignore',
|
|
275
277
|
env: childEnv,
|
|
276
278
|
});
|
|
277
279
|
child.unref();
|
|
278
280
|
} else if (platformInfo.platform === 'darwin') {
|
|
279
|
-
const openArgs = ['-a', installPath
|
|
281
|
+
const openArgs = ['-a', installPath];
|
|
282
|
+
const appArgs = [...launchArgs];
|
|
280
283
|
if (dataDir) {
|
|
281
|
-
|
|
284
|
+
appArgs.push(`--data-dir=${dataDir}`);
|
|
285
|
+
}
|
|
286
|
+
if (appArgs.length > 0) {
|
|
287
|
+
openArgs.push('--args', ...appArgs);
|
|
282
288
|
}
|
|
283
289
|
execFileSync('open', openArgs);
|
|
284
290
|
} else if (platformInfo.platform === 'linux') {
|
|
285
|
-
const child = spawn(installPath,
|
|
291
|
+
const child = spawn(installPath, launchArgs, {
|
|
286
292
|
detached: true,
|
|
287
293
|
stdio: 'ignore',
|
|
288
294
|
env: childEnv,
|
|
@@ -338,7 +344,7 @@ function findTargetDir(arguments_) {
|
|
|
338
344
|
}
|
|
339
345
|
return path.resolve(argument);
|
|
340
346
|
}
|
|
341
|
-
return
|
|
347
|
+
return null;
|
|
342
348
|
}
|
|
343
349
|
|
|
344
350
|
async function main() {
|