File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
lib/commands/doctor/checks
test/unit/commands/doctor Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ const tasks = {
5757 'Please fix your directory permissions.'
5858 ) ) ;
5959 } ) . then ( ( ) => {
60- if ( ctx . local || os . platform ( ) !== 'linux' ) {
60+ if ( ctx . local || os . platform ( ) !== 'linux' || ( ctx . argv && ctx . argv [ 'setup-linux-user' ] === false ) ) {
6161 return Promise . resolve ( ) ;
6262 }
6363
Original file line number Diff line number Diff line change @@ -210,6 +210,22 @@ describe('Unit: Doctor Checks > Install', function () {
210210 } ) ;
211211 } ) ;
212212
213+ it ( 'skips checking parent folder permissions if --no-setup-linux-user is passed' , function ( ) {
214+ let accessStub = sinon . stub ( ) . resolves ( ) ;
215+ let platformStub = sinon . stub ( ) . returns ( 'linux' ) ;
216+ const tasks = proxyquire ( modulePath , {
217+ 'fs-extra' : { access : accessStub } ,
218+ os : { platform : platformStub }
219+ } ) . tasks ;
220+ let checkDirectoryAndAbove = sinon . stub ( tasks , 'checkDirectoryAndAbove' ) . resolves ( ) ;
221+
222+ return tasks . folderPermissions ( { argv : { 'setup-linux-user' : false } } ) . then ( ( ) => {
223+ expect ( accessStub . calledOnce ) . to . be . true ;
224+ expect ( platformStub . calledOnce ) . to . be . true ;
225+ expect ( checkDirectoryAndAbove . called ) . to . be . false ;
226+ } ) ;
227+ } ) ;
228+
213229 it ( 'runs checkParentAndAbove if local not set and platform is linux' , function ( ) {
214230 let accessStub = sinon . stub ( ) . resolves ( ) ;
215231 let platformStub = sinon . stub ( ) . returns ( 'linux' ) ;
You can’t perform that action at this time.
0 commit comments