terminalforlife/ShellProjects

AutoExec: Support for JavaScript

Closed this issue · 10 comments

Fantastic idea, love the execution. Anyway possible to bring in Javascript? I have been looking for something like this for a while now. A big IDE surely can fullfil my needs, but it ain't the same. Thanks in advance.

Thank you. :) However, you've not said to which project you're referring. :P I'm guessing AutoExec.

I'm sorry, yes, you are right, I meant autoexec. I thought autoexec had its own repository. Gotta live up to my name I guess ;)

I'm aware that this has the dependency to NodeJS, deno or some other JS runtime. Right now I'm just sending a file into a loop, but it is absolutely not efficent.

LOL That was funny, because I didn't notice your name before, but it just clicked for comical effect. :D

I'll look into the possibility of adding Node.js support, but no promises. If I went for it, would you be willing to help with testing? I could set up a separate, temporary branch for this feature.

Also, usually people do have one repository storing one project, but I do things differently, and I have a lot of projects, so I don't want to be managing all those repositories. Lol It would be nice to have things be separate, especially for the users, but it'd be a real pain to update everything. I've had the same MO for years now, after all.

Sure, I will gladly test it! Right now I'm just searching for an easy way to console.log() sanely with two terminal windows to debug and test some multiliners. Hardcore coding isn't my strength, I'm more of a scripter, so I cannot go very deep on this.

My (limited) experience with Github repositories isn't of much help here. But can I just state that this conversation is so much more friendly than many of those I have read in other projects. Thanks for that!

That'd be awesome. I might look into it today. I was up late last night finishing up on AutoExec's new user-only configuration; seems to work well. Thinking about it though, couldn't you just use autoexec -e nodejs file.js or something? Maybe we were overthinking this. Lol

You're more than welcome, BTW. I've had some questionable interactions on GH, too. :/

Yes, you are absolutely right, autoexec -e node foo.js does work, holy hell. Stop all thinking and developing. Comes to show, that I should have read the man page a little bit better instead of just autoexec foo.js

It does work, and it does work well for my workflow :)

Lol Woo, that saves me hassle. :P I'll still look into a way for Node.js files to be detected by default, but if it's not reliable enough, I'll have to abandon that idea. Been a while since I've messed with Node.js; any ideas how you could reliably identify it as such a file?

I would have no problem with the standard shebang + env to be honest.

Only thing bugging me, but that is really nitpicky and not worth any hassle, is that I sometimes scroll in autoexec which leads to terminal breakage with the characters.

So a regular shebang is used for Node.js files? Goes to show how long it's been since I've used Node.js. If it is, AE should've automatically determined which executable to use. I've actually been meaning to make the shebang stuff a bit more flexible, because I think it currently only looks for #!path instead of #! path which some people prefer.

I just tested it without #!/usr/bin/env node and it worked just fine. Sorry, QA isn't my strenght. I'm just happy when something is working :)