Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ts activate"
  • Loading branch information...
commit 8cfc8688f8d223eee2ecedfbb200f8aadedd4b4e 1 parent 5c4dff3
Joshua Holbrook jfhbrook authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 lib/jitsu/commands/snapshots.js
17 lib/jitsu/commands/snapshots.js
View
@@ -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 = [
Please sign in to comment.
Something went wrong with that request. Please try again.