diff --git a/common/changes/@yuants/tool-kit/2023-12-09-15-35.json b/common/changes/@yuants/tool-kit/2023-12-09-15-35.json new file mode 100644 index 00000000..86736b5b --- /dev/null +++ b/common/changes/@yuants/tool-kit/2023-12-09-15-35.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@yuants/tool-kit", + "comment": "fix bugs", + "type": "patch" + } + ], + "packageName": "@yuants/tool-kit" +} \ No newline at end of file diff --git a/tools/toolkit/src/features/buildDockerImage.ts b/tools/toolkit/src/features/buildDockerImage.ts index ee22f1d9..f8f30aa1 100644 --- a/tools/toolkit/src/features/buildDockerImage.ts +++ b/tools/toolkit/src/features/buildDockerImage.ts @@ -137,10 +137,14 @@ export const buildDockerImage = async () => { for (const file of packageJson?.io_ntnl?.deploy_files || []) { const src = path.resolve(thisProject.projectFolder, file); - const dest = absArtifactDir; - const newPath = path.join(dest, thisProject.projectRelativeFolder, path.basename(src)); - fs.emptyDirSync(newPath); - fs.copySync(src, newPath); + if (fs.statSync(src).isFile()) { + const dest = path.join(absArtifactDir, thisProject.projectRelativeFolder); + fs.copySync(src, dest); + } else { + const dest = path.join(absArtifactDir, thisProject.projectRelativeFolder, path.basename(src)); + fs.emptyDirSync(dest); + fs.copySync(src, dest); + } } interface IImageSpec {