Skip to main content

add aliases for chflags hidden and chflags nohidden

ID
c31bff8
date
2023-09-10 08:25:23+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
9fc9edf
message
add aliases for `chflags hidden` and `chflags nohidden`
changed files
3 files, 44 additions

Changed files

fs/README.md (1942) → fs/README.md (2396)

diff --git a/fs/README.md b/fs/README.md
index 2f93e88..550e798 100644
--- a/fs/README.md
+++ b/fs/README.md
@@ -51,6 +51,16 @@ These are scripts for manipulating files and folders in my local filesystem.
   </dd>
 
   <dt>
+    <a href="https://github.com/alexwlchan/scripts/blob/main/fs/hide">
+      <code>hide [PATH]</code>
+    </a>
+  </dt>
+  <dd>
+    alias for <code>chflags hidden PATH</code>.
+    See also: <code>unhide</code>.
+  </dd>
+
+  <dt>
     <a href="https://github.com/alexwlchan/scripts/blob/main/fs/latest_download">
       <code>latest_download</code>
     </a>
@@ -74,4 +84,14 @@ These are scripts for manipulating files and folders in my local filesystem.
 -------
   7.58M ~/repos/scripts</code></pre></p>
   </dd>
+
+  <dt>
+    <a href="https://github.com/alexwlchan/scripts/blob/main/fs/unhide">
+      <code>unhide [PATH]</code>
+    </a>
+  </dt>
+  <dd>
+    alias for <code>chflags nohidden PATH</code>.
+    See also: <code>hide</code>.
+  </dd>
 </dl>

fs/hide (0) → fs/hide (135)

diff --git a/fs/hide b/fs/hide
new file mode 100755
index 0000000..cf4366c
--- /dev/null
+++ b/fs/hide
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+if (( $# != 1 ))
+then
+  echo "Usage: $0 <PATH>" >&2
+  exit 1
+fi
+
+chflags hidden $1

fs/unhide (0) → fs/unhide (137)

diff --git a/fs/unhide b/fs/unhide
new file mode 100755
index 0000000..b929cc7
--- /dev/null
+++ b/fs/unhide
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+if (( $# != 1 ))
+then
+  echo "Usage: $0 <PATH>" >&2
+  exit 1
+fi
+
+chflags nohidden $1