Skip to content

Commit

Permalink
Update Build Scripts (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-michael authored Dec 9, 2024
1 parent 1df4aa0 commit f132fe6
Show file tree
Hide file tree
Showing 6 changed files with 32,104 additions and 35,727 deletions.
9 changes: 9 additions & 0 deletions copy-by-file-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import childProcess from 'child_process';

export function copyByFileType(fileType, fromDir, toDir) {
if (process.platform === 'win32') {
childProcess.execSync(`find ${fromDir} -name '*.${fileType}' -type f -exec cp -P {} ${toDir} \;`);
} else {
childProcess.execSync(`find ${fromDir} -name '*.${fileType}' -type f -exec cp -P {} ${toDir} \;`);
}
}
5 changes: 3 additions & 2 deletions demo/copy-to-docs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const childProcess = require('child_process');
import childProcess from 'child_process';
import { copyByFileType } from '../copy-by-file-type.js';

childProcess.execSync("find ./src -name '*.css' -type f -exec cp -P {} ../docs \;");
copyByFileType('css', './src', '../docs');
childProcess.execSync("cp index.html ../docs");
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-scrubber-demo",
"scripts": {
"start": "webpack-dev-server",
"docs": "webpack -o ../docs/bundle.js && node copy-to-docs.js"
"docs": "webpack -o ../docs && node copy-to-docs.js"
},
"devDependencies": {
"@types/react": "19.0.0",
Expand Down
Loading

0 comments on commit f132fe6

Please sign in to comment.