From 8790802483113dd67adc6d2b5016bed9ef114371 Mon Sep 17 00:00:00 2001 From: liudonghua Date: Wed, 27 Dec 2023 09:18:32 +0000 Subject: [PATCH] update copyAssets, try to fix no such file --- src/git-utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/git-utils.ts b/src/git-utils.ts index 43c43866e..2531043d6 100644 --- a/src/git-utils.ts +++ b/src/git-utils.ts @@ -57,7 +57,11 @@ export async function copyAssets( } core.info(`[INFO] copy ${publishDir} to ${destDir}`); - cp('-RfL', [`${publishDir}/*`, `${publishDir}/.*`], destDir); + const sourceDir = [`${publishDir}/*`]; + if (fs.readdirSync(publishDir).some(ele => ele.startsWith('.'))) { + sourceDir.push(`${publishDir}/.*`); + } + cp('-RfL', sourceDir, destDir); await deleteExcludedAssets(destDir, excludeAssets);