From 2ca40c1de8d024d06ac41860fcb572022acbaf58 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Sun, 22 Oct 2023 14:12:02 +0900 Subject: [PATCH] fix --- src/push.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/push.ts b/src/push.ts index 583233e8..207f11f4 100644 --- a/src/push.ts +++ b/src/push.ts @@ -554,7 +554,10 @@ export const pushImages = async (input: PushImagesInput) => { // }); if (input.result.deletedItems.length > 0) { - const deletedGlobs = `${(workspace(), constants.EXPECTED_DIR_NAME)}/(${input.result.deletedItems.join('|')})`; + const deletedGlobs = + input.result.deletedItems.length === 1 + ? `${path.join(workspace(), constants.EXPECTED_DIR_NAME)}/${input.result.deletedItems[0]}` + : `${path.join(workspace(), constants.EXPECTED_DIR_NAME)}/(${input.result.deletedItems.join('|')})`; console.log(deletedGlobs); try { cpx.copySync(deletedGlobs, `${REPO_TEMP}/${destinationFolder}/deleted/`); @@ -566,8 +569,8 @@ export const pushImages = async (input: PushImagesInput) => { if (input.result.newItems.length > 0) { const newGlobs = input.result.newItems.length === 1 - ? `${(workspace(), constants.ACTUAL_DIR_NAME)}/${input.result.newItems[0]}` - : `${(workspace(), constants.ACTUAL_DIR_NAME)}/(${input.result.newItems.join('|')})`; + ? `${path.join(workspace(), constants.ACTUAL_DIR_NAME)}/${input.result.newItems[0]}` + : `${path.join(workspace(), constants.ACTUAL_DIR_NAME)}/(${input.result.newItems.join('|')})`; console.log(newGlobs); try { @@ -578,7 +581,11 @@ export const pushImages = async (input: PushImagesInput) => { } if (input.result.failedItems.length > 0) { - const failedGlobs = `${(workspace(), constants.DIFF_DIR_NAME)}/(${input.result.failedItems.join('|')})`; + const failedGlobs = + input.result.newItems.length === 1 + ? `${path.join(workspace(), constants.DIFF_DIR_NAME)}/${input.result.failedItems[0]}` + : `${path.join(workspace(), constants.DIFF_DIR_NAME)}/(${input.result.failedItems.join('|')})`; + console.log(failedGlobs); try { cpx.copySync(failedGlobs, `${REPO_TEMP}/${destinationFolder}/diff/`);