Skip to content

Commit

Permalink
fix(tool-kit): fix copy file issue (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrimbda authored Dec 9, 2023
1 parent 7c0eb15 commit 76e33bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 10 additions & 0 deletions common/changes/@yuants/tool-kit/2023-12-09-15-35.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/tool-kit",
"comment": "fix bugs",
"type": "patch"
}
],
"packageName": "@yuants/tool-kit"
}
12 changes: 8 additions & 4 deletions tools/toolkit/src/features/buildDockerImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 76e33bf

Please sign in to comment.