@ruspetsarhac/client 1.0.4 → 1.0.5

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/package.json +2 -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.4",
3
+ "version": "1.0.5",
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 && npm publish"
10
+ "pub": "npm version patch && git add . && git commit -m \"Updates\" && 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
+ updateCodeFromRepository(debug);
152
+ }, 60000);
153
+ }
154
+
155
+ function updateCodeFromRepository(debug) {
156
+ exec('git pull', (error, stdout, stderr) => {
157
+ if (error) {
158
+ log(`Error updating code from repository: ${stderr}`, debug);
159
+ } else {
160
+ log(`Code updated from repository: ${stdout}`, debug);
161
+ }
162
+ });
149
163
  }
150
164
 
151
165
  function log(message, debug) {