automatic-updates
Advanced tools
Comparing version 1.0.2 to 1.0.3
11
index.js
@@ -5,3 +5,3 @@ /* | ||
const shell = require('shelljs') | ||
const conf = require('node-etc'); | ||
const conf = require('../node-etc'); | ||
const events = require('events'); | ||
@@ -53,8 +53,2 @@ // const eventEmitter = new events.EventEmitter(); | ||
this.source = options.source | ||
// this.on('updated', restartFunc); | ||
console.log('````````````````````````````') | ||
console.log('````````````````````````````') | ||
// console.log(restartFunc) | ||
console.log('````````````````````````````') | ||
console.log('````````````````````````````') | ||
@@ -174,2 +168,3 @@ if (typeof this.interval !== 'number') throw Error(`Invalid interval type for ${this.interval}`) | ||
let update = shell.exec(`cd ${packageJsonDir} && yarn install || npm install`, { silent: true }) | ||
if (!update.includes('Already up-to-date')) { | ||
@@ -179,3 +174,3 @@ // shell.exec(`cd ${packageJsonDir} && yarn install`); | ||
}else{ | ||
this.emit('not updated', new Date().getTime()) | ||
this.emit('notUpdated', new Date().getTime()) | ||
} | ||
@@ -182,0 +177,0 @@ } |
{ | ||
"name": "automatic-updates", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Tools to automatically update nodejs programs installed as modules from npm/github.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,6 +30,8 @@ # automatic-updates | ||
```node | ||
```javascript | ||
const automaticUpdates = require('automatic-updates'); | ||
automaticUpdates.on('updated', ()=>{ | ||
process.exit() // what to do restart the service in case of an update | ||
}); | ||
automaticUpdates.init() | ||
``` | ||
@@ -36,0 +38,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99
1057500
827