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

Investigate cargo-script #1

Closed
epage opened this issue Mar 8, 2022 · 1 comment
Closed

Investigate cargo-script #1

epage opened this issue Mar 8, 2022 · 1 comment

Comments

@epage
Copy link
Owner

epage commented Mar 8, 2022

https://github.com/DanielKeep/cargo-script

@epage
Copy link
Owner Author

epage commented Mar 10, 2022

  • Requires run-cargo-script for she-bang and file associations to workaround subcommand issue
    • Subcommand for configuring file associations with a flag to adding .crs to PATHEXT
  • Hides cargo output on fast success
  • Manifest
    • cargo type code block in a doc comment
    • // cargo-deps: time="0.1.25" shorthand
  • Compilation
    • Shared CARGO_TARGET_DIR across scripts
  • Runs release by default
  • CLI expressions: --expr flag changes the interpretation of the script path positional argument to being a script
    • Includes --dep flag
    • Prints expression result using {:?}
    • Templates can be used to simplify expressions
  • Stream filters with --loop: define a closure to run on each line
  • Flags
    • --debug
    • --bench
    • --test
    • --features
    • --force (rebuild)
    • --gen-pkg-only (ie no build)
    • --clear-cache
  • Scripts receive the following env variables
  • CARGO_SCRIPT_BASE_PATH
  • CARGO_SCRIPT_PKG_NAME
  • CARGO_SCRIPT_SAFE_NAME
  • CARGO_SCRIPT_SCRIPT_PATH

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

1 participant