Updated logic and removed pref

Signed-off-by: French Ben <me+git@frenchben.com>
This commit is contained in:
French Ben 2016-03-02 17:36:40 -08:00
parent dfdf9e326e
commit d1a49abcf6
2 changed files with 21 additions and 17 deletions

View File

@ -101,8 +101,7 @@ var Setup = React.createClass({
<button className="btn btn-action" onClick={this.handleLinuxDockerInstall}>Install Docker</button> <button className="btn btn-action" onClick={this.handleLinuxDockerInstall}>Install Docker</button>
); );
} }
} else { } else if (util.isNative()) {
if (util.isNative()) {
deleteVmAndRetry = ( deleteVmAndRetry = (
<button className="btn btn-action" onClick={this.handleUseVbox}>Use VirtualBox</button> <button className="btn btn-action" onClick={this.handleUseVbox}>Use VirtualBox</button>
); );
@ -115,7 +114,6 @@ var Setup = React.createClass({
<button className="btn btn-action" onClick={this.handleToolBox}>Get Toolbox</button> <button className="btn btn-action" onClick={this.handleToolBox}>Get Toolbox</button>
); );
} }
}
return ( return (
<div className="setup"> <div className="setup">
<Header hideLogin={true}/> <Header hideLogin={true}/>

View File

@ -38,15 +38,21 @@ module.exports = {
return process.platform === 'linux'; return process.platform === 'linux';
}, },
isNative: function () { isNative: function () {
let native = JSON.parse(localStorage.getItem('settings.useNative')); // let native = JSON.parse(localStorage.getItem('settings.useNative'));
let native = null;
if (native === null) { if (native === null) {
try { try {
let stats = fs.statSync('/var/run/docker.sock'); // Check if file exists
fs.statSync('/var/run/docker.sock');
native = true; native = true;
} catch(e){ } catch (e) {
if (this.isLinux()) {
native = true;
} else {
native = false; native = false;
} }
} }
}
return native; return native;
}, },
binsPath: function () { binsPath: function () {