fix error condition
This commit is contained in:
		
							parent
							
								
									cb322b4b1a
								
							
						
					
					
						commit
						5723b368db
					
				@ -278,7 +278,7 @@ module.exports.assign = function (state, tun, cb) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    fs.access(conf.handler, fs.constants.R_OK, function (err1) {
 | 
					    fs.access(conf.handler, fs.constants.R_OK, function (err1) {
 | 
				
			||||||
      fs.stat(conf.handler, function (err2, stat) {
 | 
					      fs.stat(conf.handler, function (err2, stat) {
 | 
				
			||||||
        if (err1 || err2 && (stat.isFile() || stat.isDirectory())) {
 | 
					        if ((err1 || err2) || !(stat.isFile() || stat.isDirectory())) {
 | 
				
			||||||
          errorTcp(conf, cb);
 | 
					          errorTcp(conf, cb);
 | 
				
			||||||
          return;
 | 
					          return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -6,8 +6,16 @@ telebit init      // after install complete
 | 
				
			|||||||
telebit http 3000               // have an app listening on localhost:3000
 | 
					telebit http 3000               // have an app listening on localhost:3000
 | 
				
			||||||
telebit http 4545               // do not have an app listening
 | 
					telebit http 4545               // do not have an app listening
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					telebit http ./path/to/site
 | 
				
			||||||
 | 
					telebit http ./path/to/dir
 | 
				
			||||||
 | 
					telebit http ./path/to/file
 | 
				
			||||||
 | 
					telebit http ./doesnt/exist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
telebit ssh auto                // do have ssh listening on localhost:22
 | 
					telebit ssh auto                // do have ssh listening on localhost:22
 | 
				
			||||||
telebit ssh 4545                // do have ssh listenening
 | 
					telebit ssh 4545                // do have ssh listenening
 | 
				
			||||||
 | 
					
 | 
				
			||||||
telebit tcp 3000                // have an echo server listening on localhost:3000
 | 
					telebit tcp 3000                // have an echo server listening on localhost:3000
 | 
				
			||||||
telebit tcp 4545                // no server listening
 | 
					telebit tcp 4545                // no server listening
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					telebit tcp ./path/to/file
 | 
				
			||||||
 | 
					telebit tcp ./path/to/dir
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user