Skip to content

Commit a233f9c

Browse files
committed
chore: fix logic to always run open command, rename variables
1 parent 59d9340 commit a233f9c

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

โ€Žsrc/createIssue.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,21 @@ export function openIssueCreationLink({
100100
patchFileContents = patchFileContents.slice(0, -1)
101101
}
102102

103-
const bodyExceedsLimit = patchFileContents.length > 300;
103+
const patchContentExceedsLimit = patchFileContents.length > 300;
104104
let diffContents = patchFileContents;
105-
if (bodyExceedsLimit) {
105+
106+
if (patchContentExceedsLimit) {
106107
diffContents = '<!-- ๐Ÿ”บ๏ธ๐Ÿ”บ๏ธ๐Ÿ”บ๏ธ PLEASE REPLACE THIS BLOCK with the diff contents printed out by the `--create-issue` command. ๐Ÿ”บ๏ธ๐Ÿ”บ๏ธ๐Ÿ”บ๏ธ -->';
107108
console.log(`๐Ÿ“‹ Copy the following diff contents and paste them into the issue diff section:
108109
109110
${patchFileContents}
110111
`);
111112
}
112-
113-
else {
114-
open(
115-
`https://github.com/${vcs.org}/${vcs.repo}/issues/new?${stringify({
116-
title: "",
117-
body: `Hi! ๐Ÿ‘‹
118-
113+
open(
114+
`https://github.com/${vcs.org}/${vcs.repo}/issues/new?${stringify({
115+
title: "",
116+
body: `Hi! ๐Ÿ‘‹
117+
119118
Firstly, thanks for your work on this project! ๐Ÿ™‚
120119
121120
Today I used [patch-package](https://github.com/ds300/patch-package) to patch \`${packageDetails.name}@${packageVersion}\` for the project I'm working on.
@@ -129,8 +128,6 @@ ${diffContents}
129128
\`\`\`
130129
131130
<em>This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).</em>
132-
`,
133-
})}`,
131+
`,})}`,
134132
)
135-
}
136133
}

0 commit comments

Comments
ย (0)