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({
99
99
if ( patchFileContents . endsWith ( "\n" ) ) {
100
100
patchFileContents = patchFileContents . slice ( 0 , - 1 )
101
101
}
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 (
104
115
`https://github.com/${ vcs . org } /${ vcs . repo } /issues/new?${ stringify ( {
105
116
title : "" ,
106
117
body : `Hi! 👋
@@ -114,11 +125,12 @@ Today I used [patch-package](https://github.com/ds300/patch-package) to patch \`
114
125
Here is the diff that solved my problem:
115
126
116
127
\`\`\`diff
117
- ${ patchFileContents }
128
+ ${ diffContents }
118
129
\`\`\`
119
130
120
131
<em>This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).</em>
121
132
` ,
122
133
} ) } `,
123
134
)
135
+ }
124
136
}
You can’t perform that action at this time.
0 commit comments