Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-coho/pull/58#discussion_r19605826 --- Diff: src/nightly.js --- @@ -0,0 +1,148 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ + +var executil = require('./executil'); +var optimist = require('optimist'); +var flagutil = require('./flagutil'); +var repoutil = require('./repoutil'); +var repoupdate = require('./repo-update'); +var retrieveSha = require('./retrieve-sha'); +var npmpublish = require('./npm-publish'); +var versionutil = require('./versionutil'); +var gitutil = require('./gitutil'); +var fs = require('fs'); +var path = require('path'); + +module.exports = function*(argv) { + var repos = flagutil.computeReposFromFlag('nightly'); + var cli = repoutil.getRepoById('cli'); + var cordovaLib = repoutil.getRepoById('lib'); + var opt = flagutil.registerHelpFlag(optimist); + + argv = opt + .usage('Publish CLI & LIB to NPM under nightly tag. \n' + + 'Cordova platform add uses latest commits to the platforms. \n' + + 'Usage: $0 nightly' + ) + .options('pretend', { + desc: 'Don\'t actually publish to npm, just print what would be run.', + type:'boolean' + }) + .argv; + + if(argv.h) { + optimist.showHelp(); + process.exit(1); + } + + //Update Repos + yield repoupdate.updateRepos(repos); + + //Remove any local changes for cli & lib + yield repoutil.forEachRepo([cordovaLib, cli], function*() { + gitutil.resetFromOrigin(); + }); + + //get SHAS from platforms + var SHAJSON = yield retrieveSha(repos); + + //save SHAJSON in cordova-cli repo + yield repoutil.forEachRepo([cli], function*() { + //need to get the path to cordova-cli using executil + var cordovaclidir = yield executil.execHelper(executil.ARGS('pwd'), true, true); --- End diff -- why not just use process.cwd()?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org