How to use the fatal function from cli

Find comprehensive JavaScript cli.fatal code examples handpicked from public code repositorys.

96
97
98
99
100
101
102
103

        process.exit(0);
    }
    catch (err) {
        console.log(err);
        cli.fatal(err);
    }
});
fork icon222
star icon600
watch icon40

39
40
41
42
43
44
45
46
47
48
if (settings.deterministicOrder) {
  data.data.sort((firstFile, secondFile) => firstFile.id < secondFile.id ? -1 : 1)
}

json.writeFileSync(settings.dist, data, { spaces: 2 }, err => {
  cli.fatal(err)
})

if (settings.display) {
  cli.info(`Total files: ${Object.keys(files).length}`)
fork icon17
star icon83
watch icon3

+ 7 other calls in file

140
141
142
143
144
145
146
147
148
149
      return stringToRegExp(regexString);
    });
  }
}
catch (e) {
  cli.fatal('Could not parse JSON value \'' + value + '\'');
}
if (jsonArray instanceof Array) {
  return jsonArray;
}
fork icon601
star icon0
watch icon2

+ 11 other calls in file

38
39
40
41
42
43
44
45
46
47
  message += "For example try:\n"
  message += "    " + example + "\n"
  message += "Or see the list of options with:\n"
  message += "    craster --help"

  cli.fatal(message)
}

if (options.path) {
  if (!fs.existsSync(options.path)) cli.fatal("No such file: " + options.path)
fork icon3
star icon14
watch icon3

+ 7 other calls in file

35
36
37
38
39
40
41
42
43
44
  cli.fatal('`init` not implemented yet')
} else {
  fs.access(target, function (err) {
    if (!err) {
      cli.info('remove existing file or use --force')
      cli.fatal(target + ' already exists')
    } else {
      cli.fatal('`init` not implemented yet')
    }
  })
fork icon3
star icon12
watch icon2

+ 15 other calls in file

124
125
126
127
128
129
130
131
132
133
if(options.close) {
  closeOpenStreams();
}
else {
  if (options.ip == null) {
      return cli.fatal('You must run this cli application with a designated Ip address (eg: node index.js -ip 192.168.1.1)');
  }
  //start by grabbing all camera
  fs.readdir('/dev/', function getCameras(err, files) {
    if(err) {
fork icon1
star icon4
watch icon8

+ 15 other calls in file

85
86
87
88
89
90
91
92
93
94
                cli.info("removed dir " + tmpDir);
            }
            cli.fatal(err.stack ? err.stack : err);
        });
    } else {
        cli.fatal(err.stack ? err.stack : err);
    }
}

function runCommand(cli, command, params, ignoreFail) {
fork icon0
star icon0
watch icon12

+ 23 other calls in file

133
134
135
136
137
138
139
140
141
142
  return cut.generate_tmp_clip_path(code);
});

if(input_files.length === 0) {
  console.log(time_codes);
  cli.fatal('No timecodes');
}

video = ffmpeg(input_files.shift());
input_files.forEach(video.input, video);
fork icon0
star icon0
watch icon2

+ 3 other calls in file