Skip to content

Commit aaab532

Browse files
committed
chore: pass patchPath to createIssue, print path for user to copy
1 parent 85b4392 commit aaab532

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/createIssue.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ export function openIssueCreationLink({
120120
packageDetails,
121121
patchFileContents,
122122
packageVersion,
123+
patchPath,
123124
}: {
124125
packageDetails: PackageDetails
125126
patchFileContents: string
126127
packageVersion: string
128+
patchPath: string
127129
}) {
128130
const vcs = getPackageVCSDetails(packageDetails)
129131

@@ -149,10 +151,11 @@ export function openIssueCreationLink({
149151
const urlExceedsLimit = patchFileContents.length > 1950
150152

151153
if (urlExceedsLimit) {
152-
const diffMessage =
153-
"<!-- 🔺️🔺️🔺️ PLEASE REPLACE THIS BLOCK with the diff contents of . 🔺️🔺️🔺️ -->"
154+
const diffMessage = `<!-- 🔺️🔺️🔺️ PLEASE REPLACE THIS BLOCK with the diff contents of ${patchPath
155+
.split("/")
156+
.pop()}. 🔺️🔺️🔺️ -->`
154157
console.log(
155-
`📋 Copy the contents in and paste it in the new issue's diff section:`,
158+
`📋 Copy the contents in [ ${patchPath} ] and paste it in the new issue's diff section.`,
156159
)
157160
issueUrl = createIssueUrl({
158161
vcs,

src/makePatch.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ export function makePatch({
110110
join(resolve(packageDetails.path), "package.json"),
111111
)
112112

113-
// copy .npmrc/.yarnrc in case packages are hosted in private registry
114-
// copy .yarn directory as well to ensure installations work in yarn 2
115-
// tslint:disable-next-line:align
116-
;[".npmrc", ".yarnrc", ".yarn"].forEach((rcFile) => {
117-
const rcPath = join(appPath, rcFile)
118-
if (existsSync(rcPath)) {
119-
copySync(rcPath, join(tmpRepo.name, rcFile), { dereference: true })
120-
}
121-
})
113+
// copy .npmrc/.yarnrc in case packages are hosted in private registry
114+
// copy .yarn directory as well to ensure installations work in yarn 2
115+
// tslint:disable-next-line:align
116+
;[".npmrc", ".yarnrc", ".yarn"].forEach((rcFile) => {
117+
const rcPath = join(appPath, rcFile)
118+
if (existsSync(rcPath)) {
119+
copySync(rcPath, join(tmpRepo.name, rcFile), { dereference: true })
120+
}
121+
})
122122

123123
if (packageManager === "yarn") {
124124
console.info(
@@ -216,7 +216,7 @@ export function makePatch({
216216
"--ignore-space-at-eol",
217217
"--no-ext-diff",
218218
"--src-prefix=a/",
219-
"--dst-prefix=b/"
219+
"--dst-prefix=b/",
220220
)
221221

222222
if (diffResult.stdout.length === 0) {
@@ -306,6 +306,7 @@ export function makePatch({
306306
packageDetails,
307307
patchFileContents: diffResult.stdout.toString(),
308308
packageVersion,
309+
patchPath,
309310
})
310311
} else {
311312
maybePrintIssueCreationPrompt(packageDetails, packageManager)

0 commit comments

Comments
 (0)