From 62929263fafd9e3c1da043bc9b40fa97fccfa7a1 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 11 Feb 2022 15:20:03 +0100 Subject: fix(perms)!: change function name from `fixperms` to `resetperms` and document caution (#10686) BREAKING CHANGE: function `fixperms` has been renamed to the more accurate `resetperms`. Please read the README carefully before using it as it may badly reset the permissions. Fixes #10648 Closes #10686 --- plugins/perms/perms.plugin.zsh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'plugins/perms/perms.plugin.zsh') diff --git a/plugins/perms/perms.plugin.zsh b/plugins/perms/perms.plugin.zsh index 1a7472c1c..353b58411 100644 --- a/plugins/perms/perms.plugin.zsh +++ b/plugins/perms/perms.plugin.zsh @@ -6,25 +6,25 @@ ### Aliases # Set all files' permissions to 644 recursively in a directory -set644() { +function set644 { find "${@:-.}" -type f ! -perm 644 -print0 | xargs -0 chmod 644 } # Set all directories' permissions to 755 recursively in a directory -set755() { +function set755 { find "${@:-.}" -type d ! -perm 755 -print0 | xargs -0 chmod 755 } ### Functions -# fixperms - fix permissions on files and directories, with confirmation +# resetperms - fix permissions on files and directories, with confirmation # Returns 0 on success, nonzero if any errors occurred -fixperms () { +function resetperms { local opts confirm target exit_status chmod_opts use_slow_mode zparseopts -E -D -a opts -help -slow v+=chmod_opts if [[ $# > 1 || -n "${opts[(r)--help]}" ]]; then cat <