Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
55 lines (44 sloc)
1.2 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /******************************* | |
| Register PM | |
| *******************************/ | |
| /* | |
| Task to register component repos with Package Managers | |
| * Registers component with bower | |
| * Registers component with NPM | |
| */ | |
| var | |
| // node dependencies | |
| process = require('child_process'), | |
| // config | |
| release = require('../config/admin/release'), | |
| // register components and distributions | |
| repos = release.distributions.concat(release.components), | |
| total = repos.length, | |
| index = -1, | |
| stream, | |
| stepRepo | |
| ; | |
| module.exports = function(callback) { | |
| console.log('Registering repos with package managers'); | |
| // Do Git commands synchronously per component, to avoid issues | |
| stepRepo = function() { | |
| index = index + 1; | |
| if(index >= total) { | |
| callback(); | |
| return; | |
| } | |
| var | |
| repo = repos[index].toLowerCase(), | |
| outputDirectory = release.outputRoot + repo + '/', | |
| exec = process.exec, | |
| execSettings = {cwd: outputDirectory}, | |
| updateNPM = 'npm publish' | |
| ; | |
| /* Register with NPM */ | |
| exec(updateNPM, execSettings, function(err, stdout, stderr) { | |
| console.log(err, stdout, stderr); | |
| stepRepo(); | |
| }); | |
| }; | |
| stepRepo(); | |
| }; |