puppyperpetual 1.1.0 → 1.1.2
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 +7 -7
- package/src/ConfigManager.js +5 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "puppyperpetual",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"types": "./src/index.d.ts",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.2",
|
|
6
6
|
"description": "Run stuff FOREVER! PERPETUALLY!",
|
|
7
7
|
"main": "./src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"start": "node perpetual.js",
|
|
22
|
-
"test": "node src/
|
|
22
|
+
"test": "node src/tests/test.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"chalk": "^5.
|
|
26
|
-
"js-yaml": "^4.1.
|
|
27
|
-
"puppylog": "^1.0
|
|
28
|
-
"puppymisc": "^1.
|
|
29
|
-
"puppywebhook": "^1.
|
|
25
|
+
"chalk": "^5.6.2",
|
|
26
|
+
"js-yaml": "^4.1.1",
|
|
27
|
+
"puppylog": "^1.2.0",
|
|
28
|
+
"puppymisc": "^1.1.1",
|
|
29
|
+
"puppywebhook": "^1.1.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/ConfigManager.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import yaml from 'js-yaml';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
|
|
5
6
|
export class ConfigManager {
|
|
6
7
|
constructor(rootDir, serverName, noYAML = false) {
|
|
7
8
|
this.rootDir = rootDir;
|
|
8
9
|
this.serverName = serverName;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
13
|
+
|
|
14
|
+
this.defaultConfigPath = path.join(__dirname, 'defaultconfig.yaml');
|
|
11
15
|
this.configPath = path.join(rootDir, 'store', 'config.yaml');
|
|
12
16
|
|
|
13
17
|
if (!noYAML) {
|