Skip to content

Commit

Permalink
Fix issue with copying single files
Browse files Browse the repository at this point in the history
  • Loading branch information
younglim committed Jun 6, 2024
1 parent ded49a4 commit d85496d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"scripts": {
"build": "npm run copyfiles && tsc",
"build:watch": "npm run build -- --watch",
"copyfiles": "node ./scripts/copyFiles.js src/static/ejs dist/static/ejs",
"copyfiles": "node ./scripts/copyFiles.js src/static/ejs dist/static && node ./scripts/copyFiles.js src/constants/errorMeta.json dist/constants",
"start": "node dist/index.js",
"cli": "node dist/cli.js",
"test": "node --experimental-vm-modules ./node_modules/.bin/jest",
Expand Down
4 changes: 2 additions & 2 deletions scripts/copyfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const platform = os.platform();

if (platform === 'win32') {
// Windows
exec(`powershell -Command "New-Item -Path '${destDir}' -ItemType 'directory' -Force" && xcopy "${sourceDir}" "${destDir}" /E /I /Y`, (error, stdout, stderr) => {
exec(`powershell -Command "(New-Item -Path '${destDir}' -ItemType 'directory' -Force); (Copy-item -Path '${sourceDir}' -Destination '${destDir}' -Recurse -Force)"`, (error, stdout, stderr) => {
if (error) {
console.error(`Error: ${error.message}`);
return;
Expand All @@ -25,7 +25,7 @@ if (platform === 'win32') {
});
} else {
// Other operating systems (Linux, macOS, etc.)
exec(`mkdir -p "${destDir}" && cp -vr "${sourceDir}/." "${destDir}"`, (error, stdout, stderr) => {
exec(`mkdir -p "${destDir}" && cp -vr "${sourceDir}" "${destDir}"`, (error, stdout, stderr) => {
if (error) {
console.error(`Error: ${error.message}`);
return;
Expand Down

0 comments on commit d85496d

Please sign in to comment.