Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb committed Oct 22, 2023
1 parent 967a07d commit c87b9df
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const copyImages = async (result: CompareOutput, temp: string, dest: string): Pr
log.info(`Copying all files`);

if (result.deletedItems.length > 0) {
log.info(`Copying deleted files`);
const deletedGlobs =
result.deletedItems.length === 1
? `${path.join(workspace(), constants.EXPECTED_DIR_NAME)}/${result.deletedItems[0]}`
Expand All @@ -100,6 +101,7 @@ const copyImages = async (result: CompareOutput, temp: string, dest: string): Pr
}

if (result.newItems.length > 0) {
log.info(`Copying new files`);
const newGlobs =
result.newItems.length === 1
? `${path.join(workspace(), constants.ACTUAL_DIR_NAME)}/${result.newItems[0]}`
Expand All @@ -113,6 +115,7 @@ const copyImages = async (result: CompareOutput, temp: string, dest: string): Pr
result.failedItems.length === 1
? `${path.join(workspace(), constants.DIFF_DIR_NAME)}/${result.failedItems[0]}`
: `${path.join(workspace(), constants.DIFF_DIR_NAME)}/(${result.failedItems.join('|')})`;
log.info(`Copying diff files`, failedGlobs, `${temp}/${dest}/diff/`);
cpx.copySync(failedGlobs, `${temp}/${dest}/diff/`);

const expectedGlobs =
Expand Down

0 comments on commit c87b9df

Please sign in to comment.