Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit 654afe5

Browse files
feat: throwing meaningul errors for the watch command
1 parent 633939c commit 654afe5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/cmds/watch.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ function updatePlugin(evt, name) {
99
console.log('%s changed', name);
1010
process.stdout.write('\x1b[0m.\x1b[0m')
1111

12-
const res = execSync(`livestorm publish ${env || ''}`).toString()
13-
if (res.includes('Successfully')) {
14-
process.stdout.write('\x1b[92m.\x1b[32m')
12+
try {
13+
const res = execSync(`livestorm publish ${env || ''}`).toString()
14+
if (res.includes('Successfully')) {
15+
process.stdout.write('\x1b[92m.\x1b[32m')
16+
console.log('\x1b[0m')
17+
} else {
18+
throw(res)
19+
}
20+
} catch(err) {
21+
console.log('\x1b[31m', err.stdout.toString())
1522
console.log('\x1b[0m')
16-
} else {
17-
console.log(res)
1823
}
1924
}
2025

0 commit comments

Comments
 (0)