Open msgilligan opened 2 months ago
I had redone the template in rust so no sed needed and had decided it maybe wasn't worth it as it wasn't that much better than the script. But I can revisit given considering cross platform, if that is actually helpful to someone other than me.
At the very least you could just document that macOS users need to install GNU sed. It was pretty easy to figure out, but a comment in the script or elsewhere would IMO resolve this issue and might be simpler than publishing a Rust version.
I suspect the original author may not have had experience with macOS and thus didn't know of the differences between the versions of sed
. I think the simplest next step is to add a comment as you suggested.
But there is also another version that had to be done for windows https://github.com/emilk/eframe_template/pull/153 and now technically we've doubled the number of versions to be maintained along with needing a comment about versions of sed
.
Rust scripts haven't been stabilized yet and would require nightly to run them. Otherwise I think they would be similar level of difficulty to doing a rust script compared with the current script.
The other option is doing a cargo subcommand but that would require the user to install a binary instead of just run a script again probably not worthwhile unless you start a lot of new projects.
The main reason I didn't make a PR for the version I did was because my information doesn't change much between projects and thus I did something a bit more complicated (which in hindsight was maybe a bit too complicated) that would reuse information. The current version of what I did is online but I do not think it works well yet for the general case.
The
fill_template.sh
does not work with the built-insed
command on macOS (/usr/bin/sed
) and produces the following error:I worked around the issue by installing the Nix package
gnused
. Once that version ofsed
is first in my$PATH
fill_template.sh
works correctly.