Linted scripts

This commit is contained in:
Angelos Chalaris
2018-09-22 14:10:33 +03:00
parent b4de123e43
commit d3cf5a392a
7 changed files with 70 additions and 60 deletions

View File

@ -28,9 +28,9 @@ locales.forEach(locale => {
existingData.indexOf(` => ${snippetHash}`) !== -1
? existingData
: existingData.replace(
locData[snippetName].hash,
`${locData[snippetName].hash} => ${snippetHash}`
);
locData[snippetName].hash,
`${locData[snippetName].hash} => ${snippetHash}`
);
hashChanges.push({
snippetName,
oldHash: locData[snippetName].hash.split(' => ')[0],
@ -57,6 +57,14 @@ locales.forEach(locale => {
fs.writeFileSync(
path.join(LOCALE_PATH, locale + '_log'),
`${new Date()}\nHash changes: ${hashChanges.length}\n${
hashChanges.length ? hashChanges.map(v => `Snippet name: ${v.snippetName}\n Old hash: ${v.oldHash}\n New hash: ${v.newHash}\n`).join('\n') : ''}`
hashChanges.length
? hashChanges
.map(
v =>
`Snippet name: ${v.snippetName}\n Old hash: ${v.oldHash}\n New hash: ${v.newHash}\n`
)
.join('\n')
: ''
}`
);
});