npmci/ts/npmci.trigger.ts

18 lines
603 B
TypeScript
Raw Normal View History

2016-06-01 04:30:21 +00:00
import "typings-global";
import * as plugins from "./npmci.plugins";
import {prepare} from "./npmci.prepare";
import {bash} from "./npmci.bash";
export let trigger = function(){
let done = plugins.q.defer();
plugins.beautylog.info("now running triggers");
for(let i = 0; i < 100; i++){
let iteratorString = i.toString();
if(process.env["TRIGGER" + iteratorString]){
plugins.beautylog.log("Found TRIGGER" + iteratorString);
bash("curl -X POST " + process.env["TRIGGER" + iteratorString]);
}
}
done.resolve();
return done.promise;
}