Open file from CMD line as a known file type without extension


#1

Open file from CMD line as a known file type when file has no extension - This seems like it would be a common issue, but I found known previously questioned.

Q: I would like to be able to open a file from the command line (I know how to do this, works great) … but as a GIVEN file type. For example a shell script or json file EVEN THOUGH the filename does not have the appropriate extension.

atom myfile.sh # this already works, opens as a SHELL type atom myfile.json # this already works, opens as a JSON type, etc

$ atom myfile.foo -type SHELL # I’m looking for something like this

Ideas ??


#2

There’s no such feature built into Atom. If you want to see it work like that, you will probably have to make the change and submit a pull request.

Alternatively, if you know that you always want to open .foo files as shell scripts, you can tell Atom how to recognize that extension.