jm2 0.1.14 → 0.1.15
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/package.json +1 -1
- package/src/core/service.js +8 -1
package/package.json
CHANGED
package/src/core/service.js
CHANGED
|
@@ -501,7 +501,7 @@ class WindowsService extends PlatformService {
|
|
|
501
501
|
const dataDir = getDataDir();
|
|
502
502
|
|
|
503
503
|
const wrapper = `@echo off
|
|
504
|
-
set JM2_DATA_DIR=${dataDir}
|
|
504
|
+
set "JM2_DATA_DIR=${dataDir}"
|
|
505
505
|
"${nodePath}" "${jm2Path}" start
|
|
506
506
|
`;
|
|
507
507
|
|
|
@@ -521,6 +521,13 @@ set JM2_DATA_DIR=${dataDir}
|
|
|
521
521
|
// Create wrapper script
|
|
522
522
|
const wrapperPath = this.getWrapperPath();
|
|
523
523
|
const wrapper = this.generateWrapper();
|
|
524
|
+
|
|
525
|
+
// Ensure the data directory exists before writing the wrapper
|
|
526
|
+
const dir = dirname(wrapperPath);
|
|
527
|
+
if (!existsSync(dir)) {
|
|
528
|
+
mkdirSync(dir, { recursive: true });
|
|
529
|
+
}
|
|
530
|
+
|
|
524
531
|
writeFileSync(wrapperPath, wrapper, 'utf8');
|
|
525
532
|
|
|
526
533
|
// Install service using sc.exe
|