Skip to content

The way to go: Allow complex shell commands in the shell task#100

Open
xulongwu4 wants to merge 1 commit intoarcticicestudio:epic/gh-33-the-way-to-gofrom
xulongwu4:lo/shell
Open

The way to go: Allow complex shell commands in the shell task#100
xulongwu4 wants to merge 1 commit intoarcticicestudio:epic/gh-33-the-way-to-gofrom
xulongwu4:lo/shell

Conversation

@xulongwu4
Copy link
Contributor

This PR changes the way in which commands in a shell task are executed. It runs a cmd command in a shell task by invoking $SHELL -c cmd. This is also how shell commands were executed in the python implementation.

Pros of using $SHELL -c cmd to execute a cmd:

  1. cmd can be a complex shell commands with &&, || or pipe. This fixes The re-implementation of snowsaw in go cannot handle complex shell commands #98.
  2. Expansion of ~ and environment variables are performed the same way as regular shell commands.

@xulongwu4 xulongwu4 requested a review from svengreb as a code owner December 27, 2021 21:17
@xulongwu4 xulongwu4 changed the title Allow complex shell commands in the shell task The way to go: Allow complex shell commands in the shell task Dec 27, 2021
@arcticicestudio
Copy link
Owner

Hi @xulongwu4 👋, thanks for your contribution 👍
I'll test and review the changes within the next week(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants