File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,19 @@ export function openIssueCreationLink({
9999 if ( patchFileContents . endsWith ( "\n" ) ) {
100100 patchFileContents = patchFileContents . slice ( 0 , - 1 )
101101 }
102-
103- open (
102+
103+ const bodyExceedsLimit = patchFileContents . length > 300 ;
104+ let diffContents = patchFileContents ;
105+ if ( bodyExceedsLimit ) {
106+ diffContents = '<!-- 🔺️🔺️🔺️ PLEASE REPLACE THIS BLOCK with the diff contents printed out by the `--create-issue` command. 🔺️🔺️🔺️ -->' ;
107+ console . log ( `📋 Copy the following diff contents and paste them into the issue diff section:
108+
109+ ${ patchFileContents }
110+ ` ) ;
111+ }
112+
113+ else {
114+ open (
104115 `https://github.com/${ vcs . org } /${ vcs . repo } /issues/new?${ stringify ( {
105116 title : "" ,
106117 body : `Hi! 👋
@@ -114,11 +125,12 @@ Today I used [patch-package](https://github.com/ds300/patch-package) to patch \`
114125Here is the diff that solved my problem:
115126
116127\`\`\`diff
117- ${ patchFileContents }
128+ ${ diffContents }
118129\`\`\`
119130
120131<em>This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).</em>
121132` ,
122133 } ) } `,
123134 )
135+ }
124136}
You can’t perform that action at this time.
0 commit comments