According to the API documentation I should be able to use a File object to read something from the local filesystem with readline()
. At least from what I understand. I attempted a simple test with my Rubocop extension:
const rubyVersion = File.readline(
`${nova.workspace.path}/.ruby_version`
);
options.args.unshift("rvm-exec", rubyVersion, "bundle", "exec");
Which errors with:
Rubocop error: ReferenceError: Can't find variable: File
The same thing occurs if I try something like:
let rubyVersionFile = new File();
rubyVersionFile.path = `${nova.workspace.path}/.ruby_version`;
const rubyVersion = rubyVersionFile.readline();
options.args.unshift("rvm-exec", rubyVersion, "bundle", "exec");
This might be more of a newbie JavaScript question, but I am wondering if someone can point me to a working code example of using the linked File object.