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

Commit c68bab0

Browse files
Merge pull request #14 from livestorm/liv-4630-plugins-livestorm-publish-command-should-return-an-exit-code-when-it
fix: process exit when publish fails, liv-4630
2 parents c854717 + c58343b commit c68bab0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cmds/publish.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ function handleResponse({ status }) {
2727
if (status === 201 || status === 204) {
2828
console.log(`Successfully ${status === 201 ? 'created' : 'updated'} plugin 🎉`)
2929
} else {
30-
console.log(status)
31-
throw 'update failed'
30+
console.log('upload failed with status ' + status)
31+
process.exit(1);
3232
}
3333
}
3434

3535
function handleNetworkError(err, json) {
3636
console.log(err)
3737
console.log(`Failed to send plugin to ${json.endpoint}.`)
3838
console.log('Make sure your internet connection is working and check https://status.livestorm.co/')
39+
process.exit(1);
3940
}
4041

4142
module.exports = function publish() {
@@ -47,5 +48,6 @@ module.exports = function publish() {
4748
} catch(err) {
4849
console.log(err)
4950
console.log('Are you sure directory is a valid Livestorm plugin ?')
51+
process.exit(1);
5052
}
5153
}

0 commit comments

Comments
 (0)