diff --git a/main.js b/main.js index 9adeee6..50ea921 100644 --- a/main.js +++ b/main.js @@ -97,7 +97,7 @@ targetConfiguration.targets.forEach(target => { // Create target archive and write stream. const categoryArchive = archiver('zip') - categoryArchive.pipe(fs.createWriteStream(path.join(targetPath, `${category.name}.zip`))) + categoryArchive.pipe(fs.createWriteStream(path.join(targetPath, `${sanitizeFilename(category.name)}.zip`))) // Process all emojis in this category. const emojiBufferPromises = category.emojis.map(async (emoji) => { @@ -148,5 +148,13 @@ targetConfiguration.targets.forEach(target => { }) +function sanitizeFilename(filename) { + return filename + .replace(/&/g, 'and') + .replace(/\s/g, '_') + .toLowerCase() +} + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/package.json b/package.json index 4de4571..a3ace32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "notes-sametime-emojis", - "version": "0.1.0", + "version": "0.2.0", "description": "", "main": "main.js", "scripts": {