ioquatix / script-runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.
http://atom.io/packages/script-runner
Other
62 stars 23 forks source link

Can this plugin be used to execute a script for the current file #66

Closed mikeerickson closed 7 years ago

mikeerickson commented 7 years ago

Short of creating a separate plugin, I am trying to find a plugin which allows me to:

1. run a test (mocha, jest, ava, etc) for the current file
2. run `eslint --fix` for the current file
3. beautify `jsbeautify` for the current file
4. run any script agains the current file
- etc

I have found plugins to handle 1) and 3) and while there is a plugin for 2) it does not work reliably.

In short, just pass the current file name to any script I wish (add scripts to config.cson accordingly)

ioquatix commented 7 years ago

We thought about this. Yes, it's an interesting idea. How would it work in the UI?

ioquatix commented 7 years ago

Okay, so there is a way to do this indirectly.

Make a file like, "tasks.sh", and make each line, related to what you want to do.

e.g.

mocha test/file
eslint --fix test/file

Then, highlight that line and run using script-runner, it would only execute that one line, so only do what you want.

It's not EXACTLY what you want, but it's one way to achieve something like it.

ioquatix commented 7 years ago

I've thought about this, and I think the best option is what I've suggested above. If you have other ideas, please open a PR.