mirror of https://github.com/docker/docs.git
Updated logic and removed pref
Signed-off-by: French Ben <me+git@frenchben.com>
This commit is contained in:
parent
dfdf9e326e
commit
d1a49abcf6
|
|
@ -101,20 +101,18 @@ var Setup = React.createClass({
|
|||
<button className="btn btn-action" onClick={this.handleLinuxDockerInstall}>Install Docker</button>
|
||||
);
|
||||
}
|
||||
} else if (util.isNative()) {
|
||||
deleteVmAndRetry = (
|
||||
<button className="btn btn-action" onClick={this.handleUseVbox}>Use VirtualBox</button>
|
||||
);
|
||||
} else if (this.state.started) {
|
||||
deleteVmAndRetry = (
|
||||
<button className="btn btn-action" onClick={this.handleErrorRemoveRetry}>Delete VM & Retry Setup</button>
|
||||
);
|
||||
} else {
|
||||
if (util.isNative()) {
|
||||
deleteVmAndRetry = (
|
||||
<button className="btn btn-action" onClick={this.handleUseVbox}>Use VirtualBox</button>
|
||||
);
|
||||
} else if (this.state.started) {
|
||||
deleteVmAndRetry = (
|
||||
<button className="btn btn-action" onClick={this.handleErrorRemoveRetry}>Delete VM & Retry Setup</button>
|
||||
);
|
||||
} else {
|
||||
deleteVmAndRetry = (
|
||||
<button className="btn btn-action" onClick={this.handleToolBox}>Get Toolbox</button>
|
||||
);
|
||||
}
|
||||
deleteVmAndRetry = (
|
||||
<button className="btn btn-action" onClick={this.handleToolBox}>Get Toolbox</button>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="setup">
|
||||
|
|
|
|||
|
|
@ -38,13 +38,19 @@ module.exports = {
|
|||
return process.platform === 'linux';
|
||||
},
|
||||
isNative: function () {
|
||||
let native = JSON.parse(localStorage.getItem('settings.useNative'));
|
||||
// let native = JSON.parse(localStorage.getItem('settings.useNative'));
|
||||
let native = null;
|
||||
if (native === null) {
|
||||
try {
|
||||
let stats = fs.statSync('/var/run/docker.sock');
|
||||
// Check if file exists
|
||||
fs.statSync('/var/run/docker.sock');
|
||||
native = true;
|
||||
} catch(e){
|
||||
native = false;
|
||||
} catch (e) {
|
||||
if (this.isLinux()) {
|
||||
native = true;
|
||||
} else {
|
||||
native = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return native;
|
||||
|
|
|
|||
Loading…
Reference in New Issue