From ebc1cb4c3146e0c393e71eefd4bdc98acd077009 Mon Sep 17 00:00:00 2001 From: Kegan Myers Date: Sun, 16 Apr 2017 14:59:06 -0500 Subject: [PATCH] fix a silly bug that put everything in the same type folder --- move-media.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/move-media.js b/move-media.js index 4c1676f..f806895 100644 --- a/move-media.js +++ b/move-media.js @@ -9,11 +9,11 @@ if (argv._.length !== 2) { } const basePath = path.resolve(process.cwd(), argv._[0], 'public/system'); -const targetPath = path.resolve(process.cwd(), argv._[1], 'images/media_attachments'); +const targetPath = path.resolve(process.cwd(), argv._[1], 'images'); const targetSuffix = 'files'; const config = { - "accounts": { + accounts: { avatars: ["original", "static"], headers: ["original", "static"], }, @@ -70,7 +70,7 @@ Object.keys(config).forEach((type) => { ))).forEach((info) => { info.sizes.forEach((size) => { const sourceFile = path.join(subtypeBase, ...info.prefix, size, info[size]); - const targetDir = path.join(targetPath, info.number, targetSuffix, size); + const targetDir = path.join(targetPath, type, info.number, subtype, size); const targetFile = path.join(targetDir, 'img_'); action(sourceFile, targetDir, targetFile);