Browse Source

watcher

master
zeus 4 years ago
parent
commit
c0f9bdfddd
  1. 8
      swarmlab-app/src/run/app.js

8
swarmlab-app/src/run/app.js

@ -196,7 +196,7 @@ global.online='ob';
.on('add', function(path) { .on('add', function(path) {
console.log('File', path, 'has been added'); console.log('File', path, 'has been added');
var pathfileval = pathmodule.basename(path); var pathfileval = pathmodule.basename(path);
console.log('Filepath1 ', pathfileval, ' check'); //console.log('Filepath1 ', pathfileval, ' check');
var arrfile = pathfileval.toString().split("-"); var arrfile = pathfileval.toString().split("-");
var pathfile = arrfile[0]; var pathfile = arrfile[0];
console.log('Filepath ', pathfile, ' check'); console.log('Filepath ', pathfile, ' check');
@ -205,15 +205,15 @@ global.online='ob';
(async() => { (async() => {
var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto var token = "d2539e5a7ae1f9f1b0eb2b8f22ca467a86d28407"; // desto
var resdata = await getpipelines(token,pathfile) var resdata = await getpipelines(token,pathfile)
console.log('info-------->>>>>>>>>>>> ', JSON.stringify(resdata)); //console.log('info-------->>>>>>>>>>>> ', JSON.stringify(resdata));
console.log('info----------------------- ', JSON.stringify(resdata.data)); //console.log('info----------------------- ', JSON.stringify(resdata.data));
var resob = resdata.data var resob = resdata.data
var indexfind = global.pipelines.findIndex(x => x.res25swarmlabname==resdata.data.res25swarmlabname); var indexfind = global.pipelines.findIndex(x => x.res25swarmlabname==resdata.data.res25swarmlabname);
indexfind === -1 ? global.pipelines.push({resob}) : console.log("object already exists") indexfind === -1 ? global.pipelines.push({resob}) : console.log("object already exists")
//console.log('info', JSON.stringify(resdata)); //console.log('info', JSON.stringify(resdata));
console.log('info', JSON.stringify(global.pipelines)); console.log('info------------- ', JSON.stringify(global.pipelines));
})() })()
}) })
.on('addDir', function(path) { .on('addDir', function(path) {

Loading…
Cancel
Save