Update publish function

This commit is contained in:
Ibby Hadeed 2017-12-28 08:57:50 -05:00
parent 11a1cc2ff5
commit 2a3f015f07
No known key found for this signature in database
GPG Key ID: 1CA08EB11DAAA786

View File

@ -63,12 +63,18 @@ function prepare() {
});
}
function publish() {
// TODO apply queue system so it doesn't publish everything at once
PACKAGES.forEach((pkg: string) => {
console.log('Going to run the following command: ', `npm publish ${ pkg } ${ FLAGS }`);
// exec(`npm publish ${ pkg } ${ FLAGS }`);
async function publish() {
// TODO apply queue system to process them concurrently
for (let pkg of PACKAGES) {
// console.log('Going to run the following command: ', `npm publish ${ pkg } ${ FLAGS }`);
await new Promise<any>((resolve, reject) => {
exec(`npm publish ${ pkg } ${ FLAGS }`, (err, stdout, stderr) => {
if (err) reject(err);
if (stderr) reject(stderr);
if (stdout) resolve(stdout);
});
});
}
}
prepare();