[PATCH compass-ci] container/add-software: if cd failed, don't go on exec rm cmd

Signed-off-by: Xu Xijian <hdxuxijian@163.com> --- container/add-software/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/add-software/run b/container/add-software/run index aab659b..8a1d9ea 100755 --- a/container/add-software/run +++ b/container/add-software/run @@ -42,7 +42,7 @@ install_cmds=( addsoftware:auto bash -c " yum install -y --skip-broken --installroot=/mnt/root $packages - cd /mnt/root + cd /mnt/root && rm -rf srv/{*,.*} opt/{*,.*} mnt/{*,.*} media/{*,.*} home/{*,.*} lost+found/{*,.*} dev/{*,.*} proc/{*,.*} run/{*,.*} sys/{*,.*} > /dev/null 2>&1 " ) -- 2.23.0

addsoftware:auto bash -c " yum install -y --skip-broken --installroot=/mnt/root $packages - cd /mnt/root + cd /mnt/root &&
maybe you need to add a '\' after '&&' Thanks, Luan Shengde
rm -rf srv/{*,.*} opt/{*,.*} mnt/{*,.*} media/{*,.*} home/{*,.*} lost+found/{*,.*} dev/{*,.*} proc/{*,.*} run/{*,.*} sys/{*,.*} > /dev/null 2>&1 " ) -- 2.23.0

On Thu, Jan 21, 2021 at 10:03:37AM +0800, Luan Shengde wrote:
addsoftware:auto bash -c " yum install -y --skip-broken --installroot=/mnt/root $packages - cd /mnt/root + cd /mnt/root &&
maybe you need to add a '\' after '&&'
Thanks, Luan Shengde
In shell, there is no need to add '&&', we can see many same examples in this project, such like: [ ... ] && $cmd Thanks, Xijian
participants (2)
-
Luan Shengde
-
Xu Xijian