File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export async function runPrettier(
104104
105105 const fileLinkPrefix = `https://github.com/${ repository . repository } /tree/${ repository . commit } /` ;
106106
107- const { stdout : diff } = await spawn (
107+ let { stdout : diff } = await spawn (
108108 "git" ,
109109 [
110110 "diff" ,
@@ -116,6 +116,21 @@ export async function runPrettier(
116116 { cwd : directory } ,
117117 ) ;
118118
119+ // Remove the useless head
120+ const lines = diff . split ( "\n" ) ;
121+ for ( let lineIndex = lines . length - 1 ; lineIndex > 0 ; lineIndex -- ) {
122+ if (
123+ lines [ lineIndex ] . startsWith ( "diff --git Original|" ) &&
124+ lines [ lineIndex + 1 ] . startsWith ( "index " ) &&
125+ lines [ lineIndex + 2 ] . startsWith ( "--- Original|http://github.com/" ) &&
126+ lines [ lineIndex + 3 ] . startsWith ( "+++ Alternative|" )
127+ ) {
128+ lines . splice ( lineIndex , 2 ) ;
129+ }
130+ }
131+
132+ diff = lines . join ( "\n" ) ;
133+
119134 if ( diff ) {
120135 console . log ( diff ) ;
121136 }
You can’t perform that action at this time.
0 commit comments