commandspec icon indicating copy to clipboard operation
commandspec copied to clipboard

Feature request: running several commands with one macro

Open matklad opened this issue 7 years ago • 2 comments

Hi!

I need to run several commands in a row. Now, I do it like this:

fn install_code_extension() -> Result<()> {
    execute!(r"
cd code
npm install
    ")?;
    execute!(r"
cd code
./node_modules/vsce/out/vsce package
    ")?;
    execute!(r"
cd code
code --install-extension ./libsyntax-rust-0.0.1.vsix
    ")?;
    Ok(())
}

It would be really sweat if I was able to just

    execute!(r"
cd code
npm install
./node_modules/vsce/out/vsce package
code --install-extension ./libsyntax-rust-0.0.1.vsix
    ")?;

matklad avatar Jul 30 '18 19:07 matklad

I think this is mostly addressed by sh_execute!() right? Or do you specifically want to avoid a shell?

cgwalters avatar Mar 30 '20 19:03 cgwalters

Yeah, the original motivation was to avoid the shell (as this thing needs to be cross-platform), but I've switched to this monstrosity since.

matklad avatar Mar 30 '20 19:03 matklad