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

assignment of variable on command line and calculation of derived variables fails #3

Closed
qlx4r opened this issue Feb 22, 2025 · 3 comments

Comments

@qlx4r
Copy link

qlx4r commented Feb 22, 2025

Thank you very much for just.sh, it has been an indispensable tool for me.

I believe I have noticed a discrepancy between just and just.sh. Consider the following justfile:

foo := "111"
bar := "000" + foo 

@do:
  echo foo: {{ foo }}
  echo bar: {{ bar }}

This yields the following results:

$ just 
foo: 111
bar: 000111

$ just foo=222
foo: 222
bar: 000222

The same after compiling to just.sh:

$ ./just.sh
foo: 111
bar: 000111

$ ./just.sh foo=222
foo: 222
bar: 000111

I think that assignment of variables, and the calculation of dependent variables need to be separated out.

I am using just v1.39.0 and just.sh v0.0.2

@jstrieb
Copy link
Owner

jstrieb commented Feb 22, 2025

Hi @qlx4r, thanks for raising this, and for using just.sh!

This does seem to be a bug. I'll make a test for it, get a fix working, and push an update as soon as I can. Probably within the next few days.

Thanks again for reporting this, and for including a helpful, minimal example for me to reproduce!

@qlx4r
Copy link
Author

qlx4r commented Feb 23, 2025

Much appreciated! I forgot to mention that this also applies to the other syntax of settings variables:

$ just --set foo 222
foo: 222
bar: 000222

$ ./just.sh --set foo 222
foo: 222
bar: 000111

thank you for the quick response, and the amazing work on just.sh

@jstrieb
Copy link
Owner

jstrieb commented Feb 23, 2025

I pushed a fix that I believe works. This may not find its way into a pip release until after #2 is merged. Hopefully @lsnow99 or I will look at that soon, at which point I'll tag a new version, and then will push the latest to PyPI.

Thanks again @qlx4r for reporting this and providing a test case. I'm glad just.sh is useful to you! If you're interested in sharing at some point, I'm curious to hear more about your use case.

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