Add a ds path script
- ID
2a09f9f- date
2022-04-03 08:11:14+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
8f390bc- message
Add a ds path script- changed files
1 file, 24 additions
Changed files
ds (0) → ds (682)
diff --git a/ds b/ds
new file mode 100755
index 0000000..b6d68eb
--- /dev/null
+++ b/ds
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# This is an alias for adding files to docstore
+# (https://github.com/alexwlchan/docstore)
+#
+# When I save a file, I have to supply four bits of information:
+#
+# 1) what's the path to the file?
+# 2) where did I download it from?
+# 3) what's the title of the file?
+# 4) what's it tagged with?
+#
+# This fills in (1) and (2) automatically, so I just have to fill in
+# (3) and (4).
+#
+# I get the frontmost URL from my web browser with https://github.com/alexwlchan/safari.rs;
+# I get my latest download with another script in this repo.
+
+set -o errexit
+set -o nounset
+
+docstore add \
+ $(latest_download) \
+ --source_url=$(~/.cargo/bin/safari url) \
+ "$@"