fix error condition

This commit is contained in:
AJ ONeal 2018-07-01 01:35:45 -06:00
parent cb322b4b1a
commit 5723b368db
2 changed files with 17 additions and 9 deletions

View File

@ -278,7 +278,7 @@ module.exports.assign = function (state, tun, cb) {
fs.access(conf.handler, fs.constants.R_OK, function (err1) {
fs.stat(conf.handler, function (err2, stat) {
if (err1 || err2 && (stat.isFile() || stat.isDirectory())) {
if ((err1 || err2) || !(stat.isFile() || stat.isDirectory())) {
errorTcp(conf, cb);
return;
}

View File

@ -1,13 +1,21 @@
There are a number of conditions and whatnot that must be tested in more-or-less real-world conditions.
telebit init // fresh install
telebit init // after install complete
telebit init // fresh install
telebit init // after install complete
telebit http 3000 // have an app listening on localhost:3000
telebit http 4545 // do not have an app listening
telebit http 3000 // have an app listening on localhost:3000
telebit http 4545 // do not have an app listening
telebit ssh auto // do have ssh listening on localhost:22
telebit ssh 4545 // do have ssh listenening
telebit http ./path/to/site
telebit http ./path/to/dir
telebit http ./path/to/file
telebit http ./doesnt/exist
telebit tcp 3000 // have an echo server listening on localhost:3000
telebit tcp 4545 // no server listening
telebit ssh auto // do have ssh listening on localhost:22
telebit ssh 4545 // do have ssh listenening
telebit tcp 3000 // have an echo server listening on localhost:3000
telebit tcp 4545 // no server listening
telebit tcp ./path/to/file
telebit tcp ./path/to/dir