nuejs / create-nue

A recommended way to start a Nue project
https://nuejs.org
139 stars 30 forks source link

fix: let scripts detect current runtime #12

Closed kon-pas closed 12 months ago

kon-pas commented 1 year ago

Fixes #7 Removes the need to explicitly use the --bun flag on start:

# Previously
bun run --bun start

# Now
bun run start

It is more intuitive, because we use npm run start.

Updated the shebang to determine with which runtime to execute the script. The solution is a bit hacky and inspired by this. Initially, it runs as a shell script to detect and execute further code with either bun or node. Preventively, updated all shebangs.

tipiirai commented 12 months ago

I really like the simplified bun run start command, but those shebangs are indeed hacky and look almost like typos. I feel this might become a maintenance concern of questions. I also have a gut feeling that the bun run will be natively supported without the --bun flag? Or what do you think?

kon-pas commented 12 months ago

I agree. Let's hold off with this for now and just use the --bun flag. We will see, if this will even be a problem in the future, or just resolves itself in the process.

tipiirai commented 12 months ago

Thanks!