@ruspetsarhac/client 1.0.4 → 1.0.6
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 +2 -2
- package/src/client.js +14 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruspetsarhac/client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"main": "src/client.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"client": "./client.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "pkg client.js --targets node14-win-x64 --output client.exe",
|
|
10
|
-
"pub": "git add . && git commit -m \"Updates\" && npm version patch
|
|
10
|
+
"pub": "git add . && git commit -m \"Updates\" && npm version patch && npm publish && git push"
|
|
11
11
|
},
|
|
12
12
|
"author": "spetsar",
|
|
13
13
|
"license": "ISC"
|
package/src/client.js
CHANGED
|
@@ -146,6 +146,20 @@ function startClient(debug = false) {
|
|
|
146
146
|
}, 300000);
|
|
147
147
|
}
|
|
148
148
|
}, debug);
|
|
149
|
+
|
|
150
|
+
setInterval(() => {
|
|
151
|
+
updateDependencies(debug);
|
|
152
|
+
}, 60000);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function updateDependencies(debug) {
|
|
156
|
+
exec('npm update', (error, stdout, stderr) => {
|
|
157
|
+
if (error) {
|
|
158
|
+
log(`Error updating dependencies: ${stderr}`, debug);
|
|
159
|
+
} else {
|
|
160
|
+
log(`Dependencies updated: ${stdout}`, debug);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
function log(message, debug) {
|