From d2713240b1b5a0d70cc11bcf56eccad17d84466e Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Tue, 19 Jul 2022 09:21:13 -0700 Subject: [PATCH] [zsh] Remove nested function from darwin_configure_screenshots_directory --- .../darwin_configure_screenshots_directory | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/zsh/func/darwin_configure_screenshots_directory b/zsh/func/darwin_configure_screenshots_directory index ee7ef41..0a5e287 100644 --- a/zsh/func/darwin_configure_screenshots_directory +++ b/zsh/func/darwin_configure_screenshots_directory @@ -3,20 +3,19 @@ autoload darwin_icloud_drive_path -function darwin_configure_screenshots_directory -{ - icloud=`darwin_icloud_drive_path` - if [[ ! -d "$icloud" ]]; then - return 1 - fi +icloud=`darwin_icloud_drive_path` +if [[ ! -d "$icloud" ]]; then + return 1 +fi - # Put screenshots in iCloud Drive, in a directory according to hostname - local name=`hostname -s | tr A-Z a-z | tr ' ' -` - local screenshots_dir="$icloud/Screenshots/$name" - mkdir -p "$screenshots_dir" - defaults write com.apple.screencapture screenshots_diration "$screenshots_dir" +# Put screenshots in iCloud Drive, in a directory according to hostname +local name=`hostname -s | tr A-Z a-z | tr ' ' -` +local screenshots_dir="$icloud/Screenshots/$name" +mkdir -p "$screenshots_dir" - return 0 -} +echo "$screenshots_dir" +defaults write com.apple.screencapture screenshots_diration "$screenshots_dir" -darwin_configure_screenshots_directory "$@" +killall Dock + +return 0