Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add argument to set644 and set755 perms alias. #6959

Merged
merged 1 commit into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/perms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Plugin to handle some unix filesystem permissions quickly

### Usage

* `set755` recursively sets all directories located within the current working directory and sub directories to octal 755.
* `set644` recursively sets all files located within the current working directory and sub directories to octal 644.
* `fixperms` is a wrapper around `set755` and `set644` applied to a specified directory or the current directory otherwise. It also prompts prior to execution unlike the other two aliases.
* `set755` recursively sets all given directories (default to .) to octal 755.
* `set644` recursively sets all given files (default to .) to octal 644.
* `fixperms` is a wrapper around `set755` and `set644` applied to a specified directory or the current directory otherwise. It also prompts prior to execution unlike the other two aliases.
8 changes: 6 additions & 2 deletions plugins/perms/perms.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
### Aliases

# Set all files' permissions to 644 recursively in a directory
alias set644='find . -type f ! -perm 644 -print0 | xargs -0 chmod 644'
set644() {
find "${@:-.}" -type f ! -perm 644 -print0 | xargs -0 chmod 644
}

# Set all directories' permissions to 755 recursively in a directory
alias set755='find . -type d ! -perm 755 -print0 | xargs -0 chmod 755'
set755() {
find "${@:-.}" -type d ! -perm 755 -print0 | xargs -0 chmod 755
}

### Functions

Expand Down