Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ${{ PREFIX }} and other "build-time" vars available in script section? #851

Closed
wolfv opened this issue May 23, 2024 · 6 comments
Closed

Comments

@wolfv
Copy link
Member

wolfv commented May 23, 2024

I am wondering if it would be useful to add some variables only in the script section.

Because it would make it less annoying to deal with Windows vs. Unix env vars.

E.g. this:

    - if: unix
      then:
        - cargo install --locked --root $PREFIX --path . --no-track
      else:
        - cargo install --locked --root %PREFIX% --path .  --no-track

Could be written as:

script: cargo install --locked --root ${{ PREFIX }} --path . --no-track

However, some variables introduce a "dependency" on the parsing (for example, PREFIX usually needs the package name to be available, because the directory looks something like /bld/<package-name>-<timestamp>/placeholder).

@wolfv
Copy link
Member Author

wolfv commented May 27, 2024

Actually, it might also be nice to have ${{ PYTHON }} availalbe (which depends on ${{ PREFIX }}.

Maybe we should render this part with another Jinja context ...

@wolfv
Copy link
Member Author

wolfv commented May 27, 2024

The reason why it's nice is that it works cross-platform regardless of the shell. Switching to deno_task_shell would also work, but not sure if that's a better solution.

@schuylermartin45
Copy link
Contributor

Apologies, the issue I tagged above may be a new issue. This was the closest similar issue I could find.

@wolfv
Copy link
Member Author

wolfv commented Sep 20, 2024

No this is fine and is the correct issue indeed! :)

@wolfv
Copy link
Member Author

wolfv commented Sep 20, 2024

We also have a PR for it: #894

@wolfv
Copy link
Member Author

wolfv commented Sep 25, 2024

Initial version of this is merged!

@wolfv wolfv closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants