Use galaxy discovery for logs command

This commit is contained in:
Emily Stark
2013-06-25 10:51:52 -07:00
parent 8bce08db3e
commit 1ee24a4fcb

View File

@@ -957,9 +957,15 @@ Fiber(function () {
name: "logs",
help: "Show logs for specified site",
func: function (argv) {
var useGalaxy = !!context.galaxyUrl;
argv = require('optimist').boolean('f').argv;
var discoverResults = deployGalaxy.discoverGalaxy(argv._[1]);
var deployEndpoint = discoverResults.deployEndpoint;
var site = removeRootFromSiteName(argv._[1],
discoverResults.rootSiteName);
calculateGalaxyContextAndTunnel(deployEndpoint, context, argv);
var useGalaxy = !!context.galaxyUrl;
if (argv.help || argv._.length !== 2) {
if (useGalaxy) {
process.stdout.write(
@@ -979,14 +985,13 @@ Fiber(function () {
}
if (useGalaxy) {
var deployGalaxy = require('./deploy-galaxy.js');
deployGalaxy.logs({
context: context,
app: argv._[1],
app: site,
streaming: !!argv.f
});
} else {
deploy.logs(argv._[1]);
deploy.logs(site);
}
}
});