Permalink
Browse files

Fixing issue with webspace matching

  • Loading branch information...
1 parent 6a4510a commit e26862df68458dcd921c5c7e596a1c0f057389f4 Andre Rodrigues committed Oct 22, 2012
Showing with 47 additions and 43 deletions.
  1. +41 −39 lib/cli/commands/site.js
  2. +6 −4 lib/cli/commands/site_.js
@@ -196,14 +196,16 @@ exports.init = function (cli) {
if (context.site.webspace === undefined) {
context.site.webspace = hits[0].WebSpace;
log.verbose('Existing site location is ', context.site.webspace)
- } else if (context.site.webspace !== hits[0].WebSpace) {
+ } else {
ensureSpaces(context, _);
-
var displayNameMatches = context.spaces.filter(function (space) {
- return space.Name === context.site.webspace;
+ return space.GeoRegion === context.site.webspace;
})[0];
- throw new Error('Expected location ' + options.location + ' but was ' + displayNameMatches.GeoRegion);
+ if (displayNameMatches.Name !== hits[0].WebSpace) {
+
+ throw new Error('Expected location ' + context.site.webspace + ' but was ' + displayNameMatches.GeoRegion);
+ }
}
}
}

0 comments on commit e26862d

Please sign in to comment.