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

[Discussion] Cmd() vs Run() vs await $"" #40

Open
stratdev3 opened this issue Feb 24, 2023 · 1 comment
Open

[Discussion] Cmd() vs Run() vs await $"" #40

stratdev3 opened this issue Feb 24, 2023 · 1 comment

Comments

@stratdev3
Copy link

Hi,

There are 3 differents way to run commands :

  • Cmd()
  • Run()
  • await "command"

What are the uses cases ?

Thanks for you help

@yevhen
Copy link
Owner

yevhen commented Dec 30, 2023

Cmd - runs commands via shell interpeter (ie you could execute bash commands)
Run - executes programs (with arguments) and returns Medallion.Shell Command object which could be further composed (a-la Linux tee style) or awaited. See here
awaiting strings with cli commands - is just a fun shortcut for Run.

I would suggest using await for executing cli strings (using interpolation for arguments) as the most succinct and convenient way to run commands.

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