UNPKG
cxa-track
Version:
latest (3.0.0)
3.0.0
2.2.0
2.1.0
2.0.1
2.0.0
1.3.0
1.2.0
1.1.1
1.1.0
1.0.2
1.0.1
1.0.0
Convenient CLI to quickly update CxA tracked links
github.com/sinedied/cxa-track
sinedied/cxa-track
cxa-track
/
lib
/
run.js
12 lines
(10 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
process
from
'process'
;
import
chalk
from
'chalk'
;
export
function
safeRun
(
func, setExitCode =
true
) {
try
{
return
func
() ||
true
; }
catch
(error) {
console
.
error
(chalk.
yellow
`Error:
${error.message}
`
);
if
(setExitCode) process.
exitCode
= -
1
; } }