Skip to content

Commit

Permalink
fix: require handlebar file names processed by hbs2ui5 tool to end wi…
Browse files Browse the repository at this point in the history
…th the '.hbs' extension (#9992)

Require handlebar file names processed by hbs2ui5  to end with the `.hbs` extension, rather than have `.hbs` exist anywhere within the file names, so that when tools like VIM create temporary `.hbs.swp` files (when editing the corresponding `.hbs` files in VIM), those temporary files aren't used as actual handlebar files by the hbs2ui5.js tool.

To reproduce the issue, simply open one of the `.hbs` files using VIM (`vim`), and run a build so that the hbs2ui5 tool runs, and the below error will occur without this PR's fix, since VIM created a temporary `.hbs.swp` file that corresponds to the current `.hbs` file which is currently opened up in VM.
  • Loading branch information
stoehr authored Oct 9, 2024
1 parent 2a5c7db commit 1b23f3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/tools/lib/hbs2ui5/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const onError = (place) => {
console.log(`A problem occoured when reading ${place}. Please recheck passed parameters.`);
};

const isHandlebars = (fileName) => fileName.indexOf('.hbs') !== -1;
const isHandlebars = (fileName) => fileName.endsWith('.hbs');

const hasTypes = (file, componentName) => {
const tsFile = path.join(path.dirname(file), componentName + ".ts")
Expand Down

0 comments on commit 1b23f3d

Please sign in to comment.