-
Notifications
You must be signed in to change notification settings - Fork 476
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
OS and ARCH #263
Comments
On serious OS you can get this info using cli tools :P
Seriously - check if there is any command like this on Windows. |
Just needs to be run within a Cygwin/MinGW/MSYS based terminal. So they all have
Note that macOS does not have a So, little consistency for |
I think this would be a great feature, and I would be happy to add it to Detecting OS (MacOS/Linux/Windows/BSD, etc), arch (x86, x64, ARM, etc), and variants (Cygwin on windows, e.g.) reliably is a lot of work however, and there doesn't seem to be a crate out there that does this. I found os_info and os_type, but they don't do windows, and they rely on lsb_release being installed. (I have an nix box, and lsb_release isn't installed by default.) Given all that, I think I'd like to wait for a more robust crate which does this before adding it. |
I appreciate the work it takes to maintain things. Thanks for considering the features. Hopefully that crate will become a thing in the near future. :-) |
For now I've written a Bash script that calls another Bash script to collect and process all that data and populates the environment with those variables and launches a subshell with that environment. I then run |
Added the functions No |
Thank you Casey! But unfortunately it's not working on at least the Mac and Windows build. 😞 $ cat Justfile
sys-info:
@echo "os_family: {{os_family()}}"
@echo "os: {{os()}}"
@echo "arch: {{arch()}}"
$ ./macOS/just --version
just v0.3.4
$ ./macOS/just
error: Unknown start of token:
|
4 | @echo "os_family: {{os_family()}}"
| ^ Maybe I'm doing something wrong? I tried adding a period at the end like in your example in the readme and no change other than the addition to the period in the error output. Same error using the same |
Ah, sorry, I need to cut a release with the new features. Just a sec. |
I just pushed 0.3.5, which has the system-info functions. The windows binaries build on Appveyor. They'll appear here once they're done building: https://github.com/casey/just/releases/tag/v0.3.5 |
LOL, thanks for jumping on that Casey. 😉 |
It would be awesome if I could get variables that define
OS_NAME=Windows
,OS_VERSION_MAJOR=10
, andARCH=x86_64
on Windows 10 64-bit when launching external apps and making builds. Or to havejust
loadJustfile.win10-x86_64
overJustfile.win10
overJustfile.win
overJustfile
in such a situation. This sort of feature is the main thing I've been missing in any build/task/automation tool. I could set environment variables for all of this. But that is not ideal when the OS changes or files are copied to another system by someone else that is 32-bit vs 64-bit, etc. This is the main reason I need #262 is for managing differences betweenos
andarch
versions in myJustfile
. A great start would be those types of vars based on whatjust
was compiled for. MaybeJUST_OS=Windows
andJUST_ARCH=x86_64
being available while running theJustfile
would be enough.The text was updated successfully, but these errors were encountered: