Skip to content

Commit

Permalink
bugfix: update console build script, remove fs.cpSync (not supported …
Browse files Browse the repository at this point in the history
…until node v21)
  • Loading branch information
ptyin committed Jan 23, 2024
1 parent 6b0b328 commit 50005fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@ if (!fs.existsSync(path.join(designerDir, "dist"))) {

// copy file
const designerDestDir = path.join(__dirname,'../public/saga-statemachine-designer');
fs.cpSync(path.join(designerDir, 'dist'), designerDestDir, {recursive: true});
if (!fs.existsSync(designerDestDir)) {
fs.mkdirSync(designerDestDir)
}
fs.readdirSync(path.join(designerDir, 'dist')).forEach(file => {
fs.copyFileSync(path.join(designerDir, 'dist', file), path.join(designerDestDir, file));
});
fs.renameSync(path.join(designerDestDir, 'index.html'), path.join(designerDestDir, 'designer.html'));
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ copyList.forEach(_fileName => {
const designerDir = path.join(__dirname, '../public/saga-statemachine-designer');
const designerDestDir = path.join(destDir, 'saga-statemachine-designer');

fs.cpSync(designerDestDir, designerDir, {recursive: true});
if (!fs.existsSync(designerDestDir)) {
fs.mkdirSync(designerDestDir)
}
fs.readdirSync(designerDir).forEach(file => {
fs.copyFileSync(path.join(designerDir, file), path.join(designerDestDir, file));
});

0 comments on commit 50005fc

Please sign in to comment.