file screenshots by year also
- ID
55b2b9b- date
2022-09-18 05:52:59+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
3293100- message
file screenshots by year also- changed files
4 files, 14 additions, 20 deletions
Changed files
fun (369) → fun (296)
diff --git a/fun b/fun
index 1129fbb..838ddc3 100755
--- a/fun
+++ b/fun
@@ -5,12 +5,4 @@
# running `fun nameofdocument.pdf` will move it to the appropriate folder
# for the current year.
-set -o errexit
-set -o nounset
-
-YEAR="$(date +"%Y")"
-
-for f in "$@"
-do
- mv "$f" ~/Documents/fun/"$YEAR"
-done
+_file_by_year "~/Documents/fun" "$@"
\ No newline at end of file
github-clone (1456) → github-clone (1452)
diff --git a/github-clone b/github-clone
index cdeed7d..e3e9af1 100755
--- a/github-clone
+++ b/github-clone
@@ -20,7 +20,7 @@ set components (string split "/" "$url")
if [ "$components[3]" != "github.com" ]
echo "$url is not a GitHub repo"
- return 1
+ exit 1
end
set owner $components[4]
@@ -30,7 +30,7 @@ if [ (count $components) -gt 5 ]
# Detect if this is a pull request, and divert
if [ $components[6] = "pull" ]
github-add-pr-branch "$url"
- return $status
+ exit $status
end
end
screenshot (0) → screenshot (335)
diff --git a/screenshot b/screenshot
new file mode 100755
index 0000000..bbdfe5c
--- /dev/null
+++ b/screenshot
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+# This is a shortcut for 'mv' that I use for filing documents.
+#
+# I have a 'screenshots' directory that's divided into years; running
+# `screenshot image.png` will move it to the appropriate folder for
+# the current year.
+#
+# See also: 'fun', 'wellcome'
+
+_file_by_year "/Volumes/Media (Sapphire)/screenshots" "$@"
wellcome (389) → wellcome (317)
diff --git a/wellcome b/wellcome
index c0a8c5e..4020962 100755
--- a/wellcome
+++ b/wellcome
@@ -5,12 +5,4 @@
# work documents; running `wellcome nameofdocument.pdf` will move it
# to the appropriate folder for the current year.
-set -o errexit
-set -o nounset
-
-YEAR="$(date +"%Y")"
-
-for f in "$@"
-do
- mv "$f" ~/Documents/wellcome/"$YEAR"
-done
+_file_by_year "~/Documents/wellcome" "$@"