Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/config/lib/scripts/genEnvConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const generateEnvConfig = async () => {
resolve(
`${__dirname}/../../../../config/custom-environment-variables.json`,
),
JSON.stringify(recursiveObjCheck(sourceConfig), null, 2),
`${JSON.stringify(recursiveObjCheck(sourceConfig), null, 2)}\n`,
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/locales/lib/missing.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function missingAll() {
? fileName.replace('.json', '.js')
: fileName,
),
JSON.stringify(missingKeys, null, 2),
`${JSON.stringify(missingKeys, null, 2)}\n`,
)
log.info(TAGS.locales, fileName, 'file saved.')
}),
Expand Down
3 changes: 2 additions & 1 deletion packages/locales/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ function readLocaleDirectory(human = false) {
async function writeJson(translations, ...directories) {
try {
const resolved = resolve(...directories)
const file =
const contents =
typeof translations === 'string'
? translations
: JSON.stringify(translations, null, 2)
const file = contents.endsWith('\n') ? contents : `${contents}\n`

await fs.writeFile(resolved, file, 'utf8')
log.info(TAGS.locales, 'wrote file', `${resolved.split('/').pop()}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/masterfile/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const generate = async (save = false, historicRarity = {}, dbRarity = {}) => {
if (save) {
await fs.promises.writeFile(
resolve(`${__dirname}/data/masterfile.json`),
JSON.stringify(newMf, null, 2),
`${JSON.stringify(newMf, null, 2)}\n`,
'utf8',
)
}
Expand Down
Loading