Skip to content

Commit 5be109c

Browse files
Added AUFS
1 parent a435708 commit 5be109c

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ with sshfs.
2222
$ cd nfs:machine:/woot # mounts NFS directories
2323
$ cd enc:/path/to/encrypted # mounts an encfs directory
2424
$ cd loop:image.iso # mounts a loopback image
25+
$ cd au:/usr:/var # AUFS union mount
2526

26-
Fuse-mounted directories are unmounted automatically when you `cd` out of them.
27+
Fuse and root-mounted directories are unmounted automatically when you `cd` out
28+
of them.
2729

2830
`cd` also supports symlinks to virtual directories. For example:
2931

cd

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ cd_push_history "$PWD"
384384

385385
# process any args we have for this script
386386
if [[ $CD_EXTENSIONS = 'all' ]]; then
387-
for extension in ssh archive dev loop encfs git nfs history missing-mkdir \
388-
hdfs http postgresqlfs traverse; do
387+
for extension in ssh aufs archive dev loop encfs git nfs history \
388+
missing-mkdir hdfs http postgresqlfs traverse; do
389389
. $cd_path/cd-$extension
390390
done
391391
else

cd-aufs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# AUFS mounts | Spencer Tipping
3+
# Licensed under the terms of the MIT source code license
4+
5+
cd_on '(^|-)u:' cd_aufs_mount cd_aufs_umount
6+
7+
function cd_aufs_mount {
8+
cd_mount "cd_as_root mount -t aufs -o br:${1#u:}" "$1"
9+
}
10+
11+
function cd_aufs_umount {
12+
cd_umount "cd_as_root umount" "$@"
13+
}

cd-loop

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Single-user loopback mounting | Spencer Tipping
33
# Licensed under the terms of the MIT source code license
44

5-
cd_on '^loop:' cd_loop_mount cd_loop_umount
5+
cd_on '(^|-)loop:' cd_loop_mount cd_loop_umount
66

77
function cd_loop_mount {
88
target="${1#loop:}"

0 commit comments

Comments
 (0)