Skip to content

Commit

Permalink
fix(environment-selection): Update environment selection
Browse files Browse the repository at this point in the history
Once an environment has been found, we should stop searching for environments. I had an issue where I had:

staging: staging.domain.com
production: domain.com

When browsing on staging, it matched staging but then also matched production because "domain.com" was found in the hostname "staging.domain.com". I believe that line 140 should check for string equality rather than contains, which would alleviate this. However, adding in the return statement leaves this control up to the user of this plugin because you can set the ordering of the environments to get around it.
  • Loading branch information
tomtomau committed Mar 11, 2016
1 parent ff34743 commit ac2c5c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export class Configure {
for (let host of hostnames) {
if (hostname.search(host) !== -1) {
this.setEnvironment(env);

// We have successfully found an environment, stop searching
return;
}
}
}
Expand Down

0 comments on commit ac2c5c3

Please sign in to comment.