Permalink
Browse files

[fix] Read the package in the cwd if no app is specified for "snapsho…

…ts activate"
  • Loading branch information...
1 parent 5c4dff3 commit 8cfc8688f8d223eee2ecedfbb200f8aadedd4b4e @jfhbrook jfhbrook committed Feb 28, 2012
Showing with 13 additions and 4 deletions.
  1. +13 −4 lib/jitsu/commands/snapshots.js
@@ -120,8 +120,18 @@ snapshots.create.usage = [
];
snapshots.activate = function (name, callback) {
- var args = name ? [name] : [];
-
+
+ if (!callback) {
+ callback = name;
+
+ return jitsu.package.tryRead(process.cwd(), callback, function (pkg) {
+ snapshots.list.apply(null, [ pkg.name ].concat(executeActivate));
+ });
+ }
+ else {
+ snapshots.list.apply(null, [ name ].concat(executeActivate));
+ }
+
function executeActivate (err, snapshots, name) {
jitsu.prompt.get(['snapshot'], function (err, result) {
var snapshot = snapshots.filter(function (snap) {
@@ -135,8 +145,7 @@ snapshots.activate = function (name, callback) {
jitsu.snapshots.activate(name, snapshot.id, callback);
});
}
-
- snapshots.list.apply(null, args.concat(executeActivate));
+
};
snapshots.activate.usage = [

0 comments on commit 8cfc868

Please sign in to comment.