Skip to content

Commit 4715aae

Browse files
authored
fix(doctor): skip install dir checks for local installs (#712)
closes #711
1 parent 649bc0e commit 4715aae

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lib/commands/doctor/checks/install-folder-permissions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function installFolderPermissions(ctx) {
1616
task: taskTitle
1717
}));
1818
}).then(() => {
19-
if (ctx.local || !ctx.system.platform.linux || (ctx.argv && ctx.argv['setup-linux-user'] === false)) {
19+
const isLocal = ctx.local || (ctx.instance && ctx.instance.process.name === 'local');
20+
21+
if (isLocal || !ctx.system.platform.linux || (ctx.argv && ctx.argv['setup-linux-user'] === false)) {
2022
return Promise.resolve();
2123
}
2224

test/unit/commands/doctor/checks/install-folder-permissions-spec.js

+13
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ describe('Unit: Doctor Checks > installFolderPermissions', function () {
4242
});
4343
});
4444

45+
it('skips checking parent folder permissions if local process manager is used', function () {
46+
const accessStub = sandbox.stub(fs, 'access').resolves();
47+
const checkDirectoryStub = sandbox.stub().resolves();
48+
const installFolderPermissions = proxyquire(modulePath, {
49+
'./check-directory': checkDirectoryStub
50+
}).task;
51+
52+
return installFolderPermissions({instance: {process: {name: 'local'}}}).then(() => {
53+
expect(accessStub.calledOnce).to.be.true;
54+
expect(checkDirectoryStub.called).to.be.false;
55+
});
56+
});
57+
4558
it('skips checking parent folder permissions if os is not linux', function () {
4659
const accessStub = sandbox.stub(fs, 'access').resolves();
4760
const checkDirectoryStub = sandbox.stub().resolves();

0 commit comments

Comments
 (0)