axodotdev / cargo-dist

📦 shippable application packaging
https://axodotdev.github.io/cargo-dist/
Apache License 2.0
1.52k stars 73 forks source link

the example dist.js for bun projects doesn't resolve paths relative to the package.json dir #1330

Open Gankra opened 3 months ago

Gankra commented 3 months ago

While we defaulted to slapping the dist.js next to the package.json, many will want to shove it in a subdir. Although they will have to do a hand-edit for getting the package.json path, after that we should design the script to use the dir that's in as the root all other paths should be relative to.

This includes binScript and binPath.

I think just factoring out like "relative path to package root dir" as a constant at the top of the file would be the simplest way to do this.

https://github.com/axodotdev/axolotlsay-bun/blob/d646592821e9e466f9c2e931539c2c6f8376075b/dist.js#L27-L28