diff options
author | Marc Cornellà <hello@mcornella.com> | 2023-04-02 16:33:54 +0200 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2023-04-02 16:33:54 +0200 |
commit | d47e1d65f66f9bb2e7a96ba58797b33f0e91a623 (patch) | |
tree | 65492d66416d6164027cf0fceccea905c8a2317b /plugins/n98-magerun | |
parent | 75405b7b0ae03a1fdf2fdb172d2a50cd5f570162 (diff) | |
download | zsh-d47e1d65f66f9bb2e7a96ba58797b33f0e91a623.tar.gz zsh-d47e1d65f66f9bb2e7a96ba58797b33f0e91a623.tar.bz2 zsh-d47e1d65f66f9bb2e7a96ba58797b33f0e91a623.zip |
fix(extract): safely remove extract directory
The previous code would remove the extract directory if the command failed.
This could be bad because we're not checking if the extract directory
already existed (since we're using `mkdir -p`), so it could be possible
that the extract operation failed, and we'd be removing a directory that
already existed and had files in it.
This change only removes the directory if there are no files in it, regardless
of whether the extract operation was successful or not. This is much safer.
Diffstat (limited to 'plugins/n98-magerun')
0 files changed, 0 insertions, 0 deletions