3 ms·
Personally, I've always created shell scripts too. Or PowerShell scripts if I need Windows based support (like for Golang projects that might see Windows based
by movedx 2y ago
Personally, I've always created shell scripts too. Or PowerShell scripts if I need Windows based support (like for Golang projects that might see Windows based usage.) I find they're way, way better and easier to work with.
That being said, the only issue preventing me from using shell scripts well is shared code. Like common functions etc. So far I've simply used a common.sh script and sourced/imported it.
Also, what do you do once you have 4-5 shell scripts at the root of your project? I find it gets messy quickly. I need a solution for this.
But yes, I agree shell scripts are generally better.
- forrestthewoods 2y agoWrite a Python script instead? Easily cross platform. Nice libraries for CLI args. Easy to debug with a real debugger. Pretty nice?
- 112233 2y agoI'd take php over python any day. Everyone has their favorite python modules they like to use in scripts, half of them are not built or wrong version for whatever current distro I'm in, so I install stuff with pip, then something with requirements.txt breaks because of wrong pytorch version, I start reading about envs, much crying. At least with bash or make nobody expects you to provide external modules/libraries
- forrestthewoods 2y agoI’ve never so much as looked at a Php script in my life. I’d have to ask ChatGPT how to even run one. A build script should work with vanilla out the box Python. No extra modules needed. I mean if you can assume vanilla bash tooling then vanilla Python is perfectly fine. If there’s some Python library you really want then add it to repo. Easy peasy.
- nsonha 2y agoPHP has all the same problems (composer or whatever), plus being a shit language that NOBODY uses for scripting.
- consteval 2y agoPHP is a fantastic system scripting language IMO. Much more ergonomic for the task than Python. But I'll do you one better: Perl. Perl is incredibly stable and ergonomic for system scripting. It's probably the most ergonomic scripting lang I've ever used. The benefit is Perl is robust, unchanging for decades at a time, and available on pretty much every system. Bash is not portable, Perl is.
- 112233 2y ago> Also, what do you do once you have 4-5 shell scripts at the root of your project? I find it gets messy quickly. I need a solution for this. Put them in a folder! I see "tools" used commonly for dev/build scripts