chmod glob should exit with fase in case any chmod failed.

This commit is contained in:
sagie gur ari 2020-03-08 14:31:27 +00:00
parent a555be4805
commit 8255af645a
2 changed files with 16 additions and 6 deletions

View file

@ -2923,15 +2923,20 @@ assert ${readonly}
```sh
scope::glob_chmod::handle = glob_array ${scope::glob_chmod::argument::2}
scope::glob_chmod::count = array_length ${scope::glob_chmod::handle}
scope::glob_chmod::output = array_length ${scope::glob_chmod::handle}
for scope::glob_chmod::entry in ${scope::glob_chmod::handle}
chmod ${scope::glob_chmod::argument::1} ${scope::glob_chmod::entry}
scope::glob_chmod::result = chmod ${scope::glob_chmod::argument::1} ${scope::glob_chmod::entry}
if equals ${scope::glob_chmod::result} false
release ${scope::glob_chmod::handle}
scope::glob_chmod::output = set false
end
end
release ${scope::glob_chmod::handle}
set ${scope::glob_chmod::count}
set ${scope::glob_chmod::output}
```

View file

@ -1,11 +1,16 @@
scope::glob_chmod::handle = glob_array ${scope::glob_chmod::argument::2}
scope::glob_chmod::count = array_length ${scope::glob_chmod::handle}
scope::glob_chmod::output = array_length ${scope::glob_chmod::handle}
for scope::glob_chmod::entry in ${scope::glob_chmod::handle}
chmod ${scope::glob_chmod::argument::1} ${scope::glob_chmod::entry}
scope::glob_chmod::result = chmod ${scope::glob_chmod::argument::1} ${scope::glob_chmod::entry}
if equals ${scope::glob_chmod::result} false
release ${scope::glob_chmod::handle}
scope::glob_chmod::output = set false
end
end
release ${scope::glob_chmod::handle}
set ${scope::glob_chmod::count}
set ${scope::glob_chmod::output}