Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike North committed Jun 5, 2015
1 parent f3f60db commit 29ea12c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/try.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = CoreObject.extend({

this.ScenarioManager = new ScenarioManager({ui: this.ui, project: this.project});
return NpmHelpers.backupNpmFile(task.project.root).then(function(){
BowerHelpers.backupBowerFile(task.project.root).then(function(){
return BowerHelpers.backupBowerFile(task.project.root).then(function(){
return task.ScenarioManager.changeTo(scenario)
.then(function() {
return findEmberPath(task.project.root);
Expand Down
22 changes: 11 additions & 11 deletions lib/utils/scenario-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = CoreObject.extend({
npmJSON.resolutions = {};
}
fs.writeFileSync(npmFile, JSON.stringify(manager._npmJSONForScenario(npmJSON, scenario), null, 2));
return NpmHelpers.install(manager.project.root);
// return NpmHelpers.install(manager.project.root);
}).then(function () {
return BowerHelpers.resetBowerFile(manager.project.root).then(function(){
var bowerJSON = JSON.parse(fs.readFileSync(bowerFile));
Expand All @@ -28,7 +28,7 @@ module.exports = CoreObject.extend({

fs.writeFileSync(bowerFile, JSON.stringify(manager._bowerJSONForScenario(bowerJSON, scenario), null, 2));

return BowerHelpers.install(manager.project.root);
// return BowerHelpers.install(manager.project.root);
}).then(function(){
manager._checkVersions(scenario);
});
Expand Down Expand Up @@ -69,22 +69,22 @@ module.exports = CoreObject.extend({
return bowerJSON;
},

_packageJSONForScenario: function(npmJSON, scenario){
scenario.npmDependencies = scenario.npmDependencies || {};
scenario.npmResolutions = scenario.npmResolutions || {};
var pkgs = Object.keys(scenario.npmDependencies);
_npmJSONForScenario: function(npmJSON, scenario){
scenario.npm.dependencies = scenario.npm.dependencies || {};
scenario.npm.resolutions = scenario.npm.resolutions || {};
var pkgs = Object.keys(scenario.npm.dependencies);

pkgs.forEach(function(pkg){
if (scenario.npmDependencies[pkg] === null) {
if (scenario.npm.dependencies[pkg] === null) {
delete npmJSON.dependencies[pkg];
} else {
npmJSON.dependencies[pkg] = scenario.npmDependencies[pkg];
npmJSON.dependencies[pkg] = scenario.npm.dependencies[pkg];
}

if (scenario.npmResolutions && scenario.npmResolutions[pkg]) {
npmJSON.resolutions[pkg] = scenario.npmResolutions[pkg];
if (scenario.npm.resolutions && scenario.npm.resolutions[pkg]) {
npmJSON.resolutions[pkg] = scenario.npm.resolutions[pkg];
} else {
npmJSON.resolutions[pkg] = scenario.npmDependencies[pkg];
npmJSON.resolutions[pkg] = scenario.npm.dependencies[pkg];
}
});

Expand Down

0 comments on commit 29ea12c

Please sign in to comment.