ฉันรู้คำสั่งโซ่ปลาผ่าน&&หรือ||แต่ฉันยินดีที่จะห่วงโซ่ชุดของคำสั่งของ
รหัส
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
}
ฉันรู้คำสั่งโซ่ปลาผ่าน&&หรือ||แต่ฉันยินดีที่จะห่วงโซ่ชุดของคำสั่งของ
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
}
คำตอบ:
คุณต้องใช้beginและendคำหลักเพื่อแก้ปัญหานี้ (ขอบคุณความคิดเห็นglenn jackman ):
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
ดูเอกสารอย่างเป็นทางการเริ่มต้น - เริ่มบล็อกรหัสใหม่
begin; commands; endแทน{ commands; }- fishshell.com/docs/current/commands.html#begin