Skip to content

Commit

Permalink
generate file manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
magland committed Dec 20, 2023
1 parent 45c37a5 commit c0e7763
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
27 changes: 27 additions & 0 deletions gui/devel/generate_file_manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const fs = require('fs');
const path = require('path');

function generateFileManifest(directory, outputFileName) {
const files = [];
function traverse(currentDir) {
const items = fs.readdirSync(currentDir);
items.forEach((item) => {
const itemPath = path.join(currentDir, item);
const stats = fs.statSync(itemPath);
if (stats.isDirectory()) {
traverse(itemPath);
} else {
files.push(itemPath);
}
});
}

traverse(directory);
const files2 = files.map((file) => {
return file.substring(directory.length + 1);
})
fs.writeFileSync(outputFileName, files2.join('\n'));
}

// Usage example
generateFileManifest('dist', 'dist/file-manifest.txt');
6 changes: 3 additions & 3 deletions gui/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@fi-sci/figurl-sortingview",
"private": false,
"version": "12.0.1",
"version": "12.0.3",
"scripts": {
"dev": "vite --port 3000",
"build": "tsc && vite build",
"build": "tsc && vite build && node devel/generate_file_manifest.js",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@fi-sci/figurl-interface": "^0.3.0",
"@fi-sci/figurl-interface": "^0.1.0",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-regular-svg-icons": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
Expand Down

0 comments on commit c0e7763

Please sign in to comment.