How to chain a group of commands in Fish like { … } Bash?

2

I'm aware of chain Fish commands via && or || but I'm willing to chain a set of commands

Code

env git clone --depth=1 https://github.com/rafaelrinaldi/theme-pure.git; or {
    printf "Error: git clone of theme-pure repo failed\n"
    exit 1
}

Édouard Lopez

Posted 2016-01-15T10:26:38.033

Reputation: 220

1

Use begin; commands; end instead of { commands; } -- http://fishshell.com/docs/current/commands.html#begin

– glenn jackman – 2016-01-15T11:27:55.377

Answers

1

You need to use begin and end keywords to solve this (thanks to glenn jackman comment):

env git clone --depth=1 https://github.com/rafaelrinaldi/theme-pure.git; or begin;
    printf "Error: git clone of theme-pure repo failed\n"
    exit 1
end

Doc

See official doc begin - start a new block of code.

Édouard Lopez

Posted 2016-01-15T10:26:38.033

Reputation: 220