Permalink
Browse files

[fix] Unavailable app names and/or subdomains are now prompted for pr…

…operly.
  • Loading branch information...
1 parent 077324a commit e4f50f85aebe154d4485763be20771a6fc35377e @AvianFlu AvianFlu committed Nov 10, 2011
Showing with 14 additions and 3 deletions.
  1. +14 −3 lib/jitsu/package.js
View
@@ -512,14 +512,25 @@ function fillPackage (base, dir, callback) {
result.scripts = result.scripts || {};
jitsu.apps.available(result, function (err, isAvailable) {
+ var props, fields = [];
if (err) {
- winston.error('Unable to determine if application is deployable.');
+ winston.error('There was an error while checking app name / subdomain availability.');
return callback(err);
}
-
if (!isAvailable.available) {
+ if (isAvailable.appname === false) {
+ delete result.name;
+ fields.push('name');
+ }
+ if (isAvailable.subdomain === false) {
+ delete result.subdomain;
+ fields.push('subdomain');
+ }
+ props = descriptors.filter(function (d) {
+ return fields.indexOf(d.name) !== -1;
+ });
winston.error(isAvailable.message);
- jitsu.prompt.addProperties(result, [subdomain], createPackage)
+ jitsu.prompt.addProperties(result, props, createPackage);
return;
}

0 comments on commit e4f50f8

Please sign in to comment.