Skip to content

Commit

Permalink
JBDS-3838 Cannot install CDK
Browse files Browse the repository at this point in the history
Use current process environment instead new one
  • Loading branch information
dgolovin committed Apr 22, 2016
1 parent 7bf4fb9 commit ec344c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions browser/model/cdk.js
Expand Up @@ -175,14 +175,14 @@ class CDKInstall extends InstallableItem {
}

createEnvironment() {
let env = {};

//TODO Need to get this info from VagrantInstaller rather than hard code
let env = process.env;
let vagrantInstall = this.installerDataSvc.getInstallable('vagrant');
let vboxInstall = this.installerDataSvc.getInstallable('virtualbox');
let vgrPath = vagrantInstall.getLocation();
let vboxPath = vboxInstall.getLocation();
env['path'] = path.join(vgrPath,'bin') + ';' + vboxPath + ';';
env['path'] = env['path']
+ path.delimiter + path.join(vgrPath,'bin')
+ path.delimiter + vboxPath;
return env;
}

Expand Down
4 changes: 2 additions & 2 deletions test/unit/model/cdk-test.js
Expand Up @@ -198,10 +198,10 @@ describe('CDK installer', function() {
expect(spy).calledWith(installer.cdkDownloadedFile, installerDataSvc.installDir());
});

it('createEnvironment should return path to vagrant/bin', function() {
it('createEnvironment should return path with vagrant/bin', function() {
let installer = new CDKInstall(installerDataSvc, 900, cdkUrl, cdkBoxUrl, ocUrl, pscpUrl, null);
let env = installer.createEnvironment();
expect(env['path']).equal(path.join(installerDataSvc.vagrantDir(), 'bin') + ';' + installerDataSvc.vagrantDir() + ';');
expect(env['path']).includes(path.join(installerDataSvc.vagrantDir(), 'bin') + path.delimiter + installerDataSvc.vagrantDir());
});

it('setupVagrant should wait for vagrant install to complete', function() {
Expand Down

0 comments on commit ec344c1

Please sign in to comment.