This repository was archived by the owner on Dec 18, 2023. It is now read-only.
File tree 2 files changed +15
-8
lines changed
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ function handleResponse({ status }) {
27
27
if ( status === 201 || status === 204 ) {
28
28
console . log ( `Successfully ${ status === 201 ? 'created' : 'updated' } plugin 🎉` )
29
29
} else {
30
- console . log ( 'upload failed with status ' + status )
30
+ if ( status === 401 ) console . log ( 'your API token seems to be incorrect. Please verify that it is valid' )
31
+ else if ( status === 422 ) console . log ( 'you must set a "name" property to your environment' )
32
+ else console . log ( 'upload failed with status ' + status )
31
33
process . exit ( 1 ) ;
32
34
}
33
35
}
@@ -46,8 +48,8 @@ module.exports = function publish() {
46
48
build ( )
47
49
)
48
50
} catch ( err ) {
49
- console . log ( err )
50
- console . log ( 'Are you sure directory is a valid Livestorm plugin ?' )
51
+ console . log ( '\x1b[31m' , err . output [ 1 ] . toString ( ) )
52
+ console . log ( '\x1b[0m' , ' Are you sure directory is a valid Livestorm plugin ?')
51
53
process . exit ( 1 ) ;
52
54
}
53
55
}
Original file line number Diff line number Diff line change @@ -9,12 +9,17 @@ function updatePlugin(evt, name) {
9
9
console . log ( '%s changed' , name ) ;
10
10
process . stdout . write ( '\x1b[0m.\x1b[0m' )
11
11
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 ( ) )
15
22
console . log ( '\x1b[0m' )
16
- } else {
17
- console . log ( res )
18
23
}
19
24
}
20
25
You can’t perform that action at this time.
0 commit comments