Skip to content

Commit

Permalink
Don't warn for "duplicate" fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MMK21Hub committed Oct 31, 2022
1 parent 658dfe7 commit 5394d8a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
12 changes: 0 additions & 12 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,6 @@ async function generateTranslationStrings(
(fix) => !fix.languages || fix.languages.includes(targetLanguage)
)

const fixKeyIsDuplicated = (fixes: Fix[], fix: Fix, index: number) =>
fixes.filter((f, i) => f.key === fix.key && index > i).length
const duplicateFixes = fixes.filter((fix, i) =>
fixKeyIsDuplicated(fixes, fix, i)
)

duplicateFixes.forEach(({ key }) =>
console.warn(
`[${brand}] Translation key ${key} has multiple fixes that target it`
)
)

for (const { key, transformer } of fixes) {
const transformerName = Object.getPrototypeOf(transformer).constructor.name
const logger = new TransformerLogger()
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const cache = new Map<string, any>()
const commandLineArg = process.argv[2]

const targetVersions: MinecraftVersionFancyRange = {
start: "22w43a",
start: "1.19.2",
}
// const targetVersions = "1.19.2"
// const targetVersions: StartAndEnd<string> = ["1.19.1-pre1", null]
Expand Down
1 change: 1 addition & 0 deletions src/publisher/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async function askForChangelog(): Promise<string> {
const changelogFileName = "changelog.md"
const changelogFilePath = join(releaseConfigFolder, changelogFileName)
await ensureDir(releaseConfigFolder)
// Create the file (with no content) if it doesn't already exist:
await writeFile(changelogFilePath, Buffer.from(""), {
flag: "a",
})
Expand Down

0 comments on commit 5394d8a

Please sign in to comment.