Skip to content

Commit

Permalink
Enable IDE code-highlighting for bin-file
Browse files Browse the repository at this point in the history
By adding the `.js`-extension to the bin-file, IDEs will
know that js code-highlighting should be applied to the
file, which makes it easier for devs to read the code.
  • Loading branch information
jaylinski committed Jan 2, 2022
1 parent 0896d00 commit 30bd78d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion bin/handlebars → bin/handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ delete argv._;

const Precompiler = require('../dist/cjs/precompiler');
Precompiler.loadTemplates(argv, function(err, opts) {

if (err) {
throw err;
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"./runtime": "./dist/cjs/handlebars.runtime.js"
},
"bin": {
"handlebars": "bin/handlebars"
"handlebars": "bin/handlebars.js"
},
"scripts": {
"build": "grunt build",
Expand Down
2 changes: 1 addition & 1 deletion spec/expected/help.menu.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Precompile handlebar templates.
Usage: handlebars [template|directory]...
Usage: handlebars.js [template|directory]...

Options:
--help Outputs this message [boolean]
Expand Down
4 changes: 2 additions & 2 deletions tasks/test-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ function executeBinHandlebars(...args) {
if (os.platform() === 'win32') {
// On Windows, the executable handlebars.js file cannot be run directly
const nodeJs = process.argv[0];
return execFilesSyncUtf8(nodeJs, ['./bin/handlebars'].concat(args));
return execFilesSyncUtf8(nodeJs, ['./bin/handlebars.js'].concat(args));
}
return execFilesSyncUtf8('./bin/handlebars', args);
return execFilesSyncUtf8('./bin/handlebars.js', args);
}

function execFilesSyncUtf8(command, args) {
Expand Down

0 comments on commit 30bd78d

Please sign in to comment.