File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -36,11 +36,6 @@ exports.setOptions = function (optimist) {
36
36
} ;
37
37
38
38
exports . run = function ( options ) {
39
- // 权限降级
40
- if ( process . env [ 'SUDO_UID' ] ) {
41
- process . setuid ( parseInt ( process . env [ 'SUDO_UID' ] ) ) ;
42
- }
43
-
44
39
var app = connect ( ) ,
45
40
cwd = options . cwd ,
46
41
verbose = options . v || options . verbose ,
@@ -376,6 +371,11 @@ exports.run = function (options) {
376
371
proxyProcess = child_process . fork ( proxyPath ) ;
377
372
}
378
373
374
+ // 权限降级
375
+ if ( process . env [ 'SUDO_UID' ] ) {
376
+ process . setuid ( parseInt ( process . env [ 'SUDO_UID' ] ) ) ;
377
+ }
378
+
379
379
// exitHandler && catches ctrl+c event
380
380
process . on ( 'exit' , exitHandler . bind ( null ) ) ;
381
381
process . on ( 'SIGINT' , exitHandler . bind ( null ) ) ;
Original file line number Diff line number Diff line change @@ -32,11 +32,6 @@ exports.setOptions = (optimist) => {
32
32
} ;
33
33
34
34
exports . run = ( options ) => {
35
- // 权限降级
36
- if ( process . env [ 'SUDO_UID' ] ) {
37
- process . setuid ( parseInt ( process . env [ 'SUDO_UID' ] ) ) ;
38
- }
39
-
40
35
let app = connect ( ) ,
41
36
cwd = options . cwd ,
42
37
verbose = options . v || options . verbose ,
@@ -367,6 +362,11 @@ exports.run = (options) => {
367
362
proxyProcess = child_process . fork ( proxyPath ) ;
368
363
}
369
364
365
+ // 权限降级
366
+ if ( process . env [ 'SUDO_UID' ] ) {
367
+ process . setuid ( parseInt ( process . env [ 'SUDO_UID' ] ) ) ;
368
+ }
369
+
370
370
// exitHandler && catches ctrl+c event
371
371
process . on ( 'exit' , exitHandler . bind ( null ) ) ;
372
372
process . on ( 'SIGINT' , exitHandler . bind ( null ) ) ;
You can’t perform that action at this time.
0 commit comments