summaryrefslogtreecommitdiff
path: root/bin/mkrc.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mkrc.in')
-rwxr-xr-xbin/mkrc.in20
1 files changed, 18 insertions, 2 deletions
diff --git a/bin/mkrc.in b/bin/mkrc.in
index 8932926..da22a63 100755
--- a/bin/mkrc.in
+++ b/bin/mkrc.in
@@ -23,7 +23,7 @@ destination() {
show_help() {
local exit_code=${1:-0}
- $PRINT "Usage: mkrc [-ChSsVvqo] [-t TAG] [-d DIR] [-B HOSTNAME] FILES ..."
+ $PRINT "Usage: mkrc [-ChSsUuVvqo] [-t TAG] [-d DIR] [-B HOSTNAME] FILES ..."
$PRINT "see mkrc(1) and rcm(7) for more details"
exit $exit_code
@@ -44,9 +44,10 @@ in_host=0
version=0
always_copy=0
force_symlink=50
+undotted=50
install_args=
-while getopts :ChSsVvqot:d:B: opt; do
+while getopts :ChSsUuVvqot:d:B: opt; do
case "$opt" in
C) always_copy=1 ;;
h) show_help ;;
@@ -58,6 +59,8 @@ while getopts :ChSsVvqot:d:B: opt; do
V) version=1 ;;
S) force_symlink=1 ;;
s) force_symlink=0 ;;
+ U) undotted=1 ;;
+ u) undotted=0 ;;
B)
in_host=1
hostname="$OPTARG"
@@ -93,11 +96,24 @@ elif [ $force_symlink -eq 0 ]; then
done
fi
+if [ $undotted -eq 1 ]; then
+ for file in $files; do
+ dedotted="$(de_dot "$file")"
+ INSTALL="$INSTALL -U $dedotted"
+ done
+elif [ $undotted -eq 0 ]; then
+ for file in $files; do
+ dedotted="$(de_dot "$file")"
+ INSTALL="$INSTALL -u $dedotted"
+ done
+fi
+
for file in $files; do
case "$file" in
/*) : ;;
*) [ -e "$PWD/$file" ] && file="$PWD/$file" ;;
esac
+
dotless="$(de_dot "$file")"
dest="$(destination "$DOTFILES_DIR" "$dotless" $in_host "$tag")"
mkdir -p "$dest/$(dirname "$dotless")"