Skip to content

Commit

Permalink
fix(doctor): skip install dir checks for local installs (#712)
Browse files Browse the repository at this point in the history
closes #711
  • Loading branch information
aileen authored May 9, 2018
1 parent 649bc0e commit 4715aae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/commands/doctor/checks/install-folder-permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function installFolderPermissions(ctx) {
task: taskTitle
}));
}).then(() => {
if (ctx.local || !ctx.system.platform.linux || (ctx.argv && ctx.argv['setup-linux-user'] === false)) {
const isLocal = ctx.local || (ctx.instance && ctx.instance.process.name === 'local');

if (isLocal || !ctx.system.platform.linux || (ctx.argv && ctx.argv['setup-linux-user'] === false)) {
return Promise.resolve();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ describe('Unit: Doctor Checks > installFolderPermissions', function () {
});
});

it('skips checking parent folder permissions if local process manager is used', function () {
const accessStub = sandbox.stub(fs, 'access').resolves();
const checkDirectoryStub = sandbox.stub().resolves();
const installFolderPermissions = proxyquire(modulePath, {
'./check-directory': checkDirectoryStub
}).task;

return installFolderPermissions({instance: {process: {name: 'local'}}}).then(() => {
expect(accessStub.calledOnce).to.be.true;
expect(checkDirectoryStub.called).to.be.false;
});
});

it('skips checking parent folder permissions if os is not linux', function () {
const accessStub = sandbox.stub(fs, 'access').resolves();
const checkDirectoryStub = sandbox.stub().resolves();
Expand Down

0 comments on commit 4715aae

Please sign in to comment.