Skip to content

Commit

Permalink
[FIX] bundle_xml: small fixes for script bundling the xmls
Browse files Browse the repository at this point in the history
Two issues :
1) bundle_xml script had the wrong default value if the argument "--outDir"
wasn't specified.
2) the syntax 'build:xml ...' in package.json wasn't working in windows.
Replaced `'build...'` by `\"build...\"` to fix it.

closes #2159

X-original-commit: 6a30375
Signed-off-by: Rémi Rahir (rar) <[email protected]>
Signed-off-by: Minne Adrien (adrm) <[email protected]>
  • Loading branch information
hokolomopo committed Mar 3, 2023
1 parent ed59c21 commit a760a40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:js": "tsc --module es6 --incremental",
"bundle:js": "rollup -c -m dev",
"bundle:xml": "node tools/bundle_xml/main.js",
"build": "npm-run-all build:js bundle:js 'bundle:xml -- --outDir build'",
"build": "npm-run-all build:js bundle:js \"bundle:xml -- --outDir build\"",
"doc": "typedoc",
"precommit": "npm run prettier && npm run doc",
"test": "jest",
Expand Down
8 changes: 5 additions & 3 deletions tools/bundle_xml/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const bundle = require("./bundle_xml_templates");

const outDirAgIndex = process.argv.findIndex((arg) => arg === "--outDir") + 1;
const outDir = process.argv[outDirAgIndex] || "dist";
const DEFAULT_DIR = "dist";

bundle.writeOwlTemplateBundleToFile(outDir);
const outDirFlagIndex = process.argv.findIndex((arg) => arg === "--outDir");
const outDir = outDirFlagIndex !== -1 ? process.argv[outDirFlagIndex + 1] : DEFAULT_DIR;

bundle.writeOwlTemplateBundleToFile(outDir || DEFAULT_DIR);

0 comments on commit a760a40

Please sign in to comment.