From 87e4a278ff00acb93cd1987cd795a72e8dddfa0b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 25 Feb 2016 18:37:54 -0500 Subject: [PATCH] Remove unused script --- scripts/org-clean.zsh | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 scripts/org-clean.zsh diff --git a/scripts/org-clean.zsh b/scripts/org-clean.zsh deleted file mode 100755 index 71be43cc..00000000 --- a/scripts/org-clean.zsh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env zsh - -# A cleanup script for attachments in my org-mode notes. - -ORG_DIR="$HOME/Dropbox/org" -ATTACH_DIR=".attach" -IFS=$'\n' - -attachment_dirs() { - find "$ORG_DIR" -iname "$ATTACH_DIR" -type d -} - -attachments_in_dir() { - cd "$1/../" - find ".attach" -type f -} - -is_orphaned_file() { - cd "$ORG_DIR" - ag -Q "$1" >/dev/null -} - -if [[ "$1" == "-n" ]]; then - DRY_RUN=1 - echo "Running dry run!" -fi - -for folder in $(attachment_dirs); do - cd "$folder" - for file in $(attachments_in_dir "$folder"); do - if ! is_orphaned_file "$file"; then - [[ -z "$DRY_RUN" ]] && rm -f "$file" - echo "Deleted '$file'" - fi - done -done