|
|
@ -12,6 +12,8 @@ let |
|
|
|
// node dependencies
|
|
|
|
process = require('child_process'), |
|
|
|
|
|
|
|
npmPublish = require('@jsdevtools/npm-publish'), |
|
|
|
|
|
|
|
// config
|
|
|
|
release = require('../config/admin/release'), |
|
|
|
|
|
|
@ -29,21 +31,42 @@ module.exports = function(callback) { |
|
|
|
console.log('Registering repos with package managers'); |
|
|
|
|
|
|
|
// Do Git commands synchronously per component, to avoid issues
|
|
|
|
stepRepo = function() { |
|
|
|
stepRepo = async function() { |
|
|
|
|
|
|
|
index = index + 1; |
|
|
|
if(index >= total) { |
|
|
|
callback(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let |
|
|
|
fs = require('fs'), |
|
|
|
config = fs.existsSync(__dirname + '/../config/admin/oauth.js') |
|
|
|
? require('../config/admin/oauth') |
|
|
|
: false, |
|
|
|
repo = repos[index].toLowerCase(), |
|
|
|
outputDirectory = release.outputRoot + repo + '/', |
|
|
|
outputDirectory = `${release.outputRoot}${repo}/`, |
|
|
|
exec = process.exec, |
|
|
|
execSettings = {cwd: outputDirectory}, |
|
|
|
updateNPM = 'npm publish;meteor publish;' |
|
|
|
updateNPM = 'meteor publish;' |
|
|
|
; |
|
|
|
|
|
|
|
/* Register with NPM */ |
|
|
|
console.info(`NPM Token "${config.npmToken}"`); |
|
|
|
console.info(`NPM Publish "${repo}"`); |
|
|
|
console.info(outputDirectory); |
|
|
|
await npmPublish({ |
|
|
|
package: `${outputDirectory}/package.json`, |
|
|
|
token: config.npmToken, |
|
|
|
greaterVersionOnly: true, |
|
|
|
debug: function(log) { |
|
|
|
console.log(log); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
/* Register with NPM */ |
|
|
|
console.info(`Meteor publish "${repo}"`); |
|
|
|
console.info(outputDirectory); |
|
|
|
exec(updateNPM, execSettings, function(err, stdout, stderr) { |
|
|
|
console.log(err, stdout, stderr); |
|
|
|
stepRepo(); |
|
|
|