Skip to content

Commit a681542

Browse files
committed
fix(doctor): set find maxBuffer to infinity
closes #801 - set maxBuffer size to infinity
1 parent 02d506a commit a681542

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/commands/doctor/checks/check-permissions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function checkPermissions(type, task) {
2727
}
2828
};
2929

30-
return execa.shell(checkTypes[type].command).then((result) => {
30+
return execa.shell(checkTypes[type].command, {maxBuffer: Infinity}).then((result) => {
3131
if (!result.stdout) {
3232
return Promise.resolve();
3333
}

test/unit/commands/doctor/checks/check-permissions-spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Unit: Doctor Checks > Util > checkPermissions', function () {
1616
const execaStub = sinon.stub(execa, 'shell').resolves({stdout: ''});
1717

1818
return checkPermissions().then(() => {
19-
expect(execaStub.calledWithExactly('find ./content ! -group ghost ! -user ghost')).to.be.true;
19+
expect(execaStub.calledWithExactly('find ./content ! -group ghost ! -user ghost', {maxBuffer: Infinity})).to.be.true;
2020
});
2121
});
2222

@@ -28,7 +28,7 @@ describe('Unit: Doctor Checks > Util > checkPermissions', function () {
2828
}).catch((error) => {
2929
expect(error).to.be.an.instanceof(errors.SystemError);
3030
expect(error.message).to.match(/Ghost can't access some files or directories to check for correct permissions./);
31-
expect(execaStub.calledWithExactly('find ./ -type d ! -perm 775 ! -perm 755')).to.be.true;
31+
expect(execaStub.calledWithExactly('find ./ -type d ! -perm 775 ! -perm 755', {maxBuffer: Infinity})).to.be.true;
3232
});
3333
});
3434

@@ -40,7 +40,7 @@ describe('Unit: Doctor Checks > Util > checkPermissions', function () {
4040
}).catch((error) => {
4141
expect(error).to.be.an.instanceof(errors.ProcessError);
4242
expect(error.message).to.match(/oops, cmd could not be executed/);
43-
expect(execaStub.calledWithExactly('find ./ -type f ! -path "./versions/*" ! -perm 664 ! -perm 644')).to.be.true;
43+
expect(execaStub.calledWithExactly('find ./ -type f ! -path "./versions/*" ! -perm 664 ! -perm 644', {maxBuffer: Infinity})).to.be.true;
4444
});
4545
});
4646
});

0 commit comments

Comments
 (0)