@@ -17,17 +17,18 @@ await Promise.all([
17
17
await Promise . all ( [
18
18
( async ( ) => {
19
19
try {
20
- // `git status --porecelain` is empty when the tree is clean
21
- const { stdout : status } = await readGit ( 'status' , '--porcelain' )
22
- if ( status . trim ( ) !== '' ) errors . push ( "/!\\ The git working tree is not clean" )
23
-
24
20
const { stdout : branch } = await readGit ( 'branch' , '--show-current' )
25
21
if ( branch !== "main\n" ) {
26
22
errors . push ( `/!\\ We are on branch ${ branch . trim ( ) } , we publish from main` )
27
23
28
24
}
25
+ // `git status --porecelain` is empty when the tree is clean
26
+ const { stdout : status } = await readGit ( 'status' , '--porcelain' )
27
+ if ( status . trim ( ) !== '' ) errors . push ( "/!\\ The git working tree is not clean" )
28
+
29
+ const _ignore = await readGit ( 'push' , '--dry-run' , '--porcelain' )
29
30
} catch ( { stderr, stdout} ) {
30
- errors . push ( "/!\\ git status or git branch error:" , stdout , stderr )
31
+ errors . push ( "/!\\ git status, git branch or git push --dry-run error:" , stdout , stderr )
31
32
}
32
33
} ) ( ) ,
33
34
( async ( ) => {
@@ -62,7 +63,7 @@ await Promise.all([
62
63
63
64
64
65
if ( errors . length !== 0 ) {
65
- console . error ( '\n' + errors . join ( '\n\n' ) + '\n' )
66
+ console . error ( '\n' + errors . filter ( x => x !== '' ) . join ( '\n\n' ) + '\n' )
66
67
process . exit ( 1 )
67
68
}
68
69
0 commit comments