-
Notifications
You must be signed in to change notification settings - Fork 744
Allow shjs utility to infer the extension for "filename." #278
Copy link
Copy link
Closed
Labels
Description
Currently, the shjs utility can sometimes infer the file extension of the script name. For example:
$ cat input.js
require('shelljs/global');
echo('Hello world');
$ shjs input.js
Hello world
$ shjs input # .js extension will be inferred
Hello world
$ shjs input. # it'd be nice if the .js extension could be inferred here as well
ShellJS: script not found (input.)
I often find myself writing out simple shelljs scripts and their bash equivalents, and I usually name them similarly (input.js and input.sh respectively, for example). Tab complete will complete up to $ shjs input., so it'd be convenient if shjs would infer that I want to run the .js file.
Since the utility already infers file extensions, this would just be a (perhaps more useful) expansion of that.
Reactions are currently unavailable