Skip to content

How use and operator? #20

@MeGaPk

Description

@MeGaPk

Hello!
I have question.
I have this code:

session := sh.NewSession()
    session.SetTimeout(time.Second * 30)
    session.ShowCMD = true
    session.SetDir(repositoryPath)
    session.Command(
        "rm", "-f", archiveFile, "&&",
        "git", "archive", branchName, "--format", "tar", "--output", archiveFile,
    )

And debug message:
[golang-sh]$ rm -f /tmp/archive.tar && git archive origin/master --format tar --output /tmp/archive.tar
But second command not executed...
If i remove "rm", "-f", archiveFile, "&&",
Its work, but i need this "&&" operator.
What mistake?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions