mirror of
https://github.com/sagiegurari/duckscript
synced 2024-10-14 11:53:05 +00:00
chmod glob should exit with fase in case any chmod failed.
This commit is contained in:
parent
a555be4805
commit
8255af645a
11
docs/sdk.md
11
docs/sdk.md
|
@ -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}
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue