Skip to content

Commit

Permalink
fix(doctor): set find maxBuffer to infinity
Browse files Browse the repository at this point in the history
closes #801
- set maxBuffer size to infinity
  • Loading branch information
acburdine committed Aug 29, 2018
1 parent 02d506a commit a681542
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/commands/doctor/checks/check-permissions.js
Expand Up @@ -27,7 +27,7 @@ module.exports = function checkPermissions(type, task) {
}
};

return execa.shell(checkTypes[type].command).then((result) => {
return execa.shell(checkTypes[type].command, {maxBuffer: Infinity}).then((result) => {
if (!result.stdout) {
return Promise.resolve();
}
Expand Down
6 changes: 3 additions & 3 deletions test/unit/commands/doctor/checks/check-permissions-spec.js
Expand Up @@ -16,7 +16,7 @@ describe('Unit: Doctor Checks > Util > checkPermissions', function () {
const execaStub = sinon.stub(execa, 'shell').resolves({stdout: ''});

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

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

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

0 comments on commit a681542

Please sign in to comment.