From 0b41faff6b317532072b2ab85b6a48396fffa98e Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 25 Apr 2022 19:28:26 +0900 Subject: [PATCH] use local --- install | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/install b/install index 6fa0ffc..b8f4c79 100755 --- a/install +++ b/install @@ -2,12 +2,17 @@ set -euo pipefail cd -- "$(dirname -- "$0")" -for dotfile in .*; do - [[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue +function main() { + local dotfile + for dotfile in .*; do + [[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue - dotfile=$(realpath "$dotfile") - ( - cd - ln -svf "$dotfile" . - ) -done + dotfile=$(realpath "$dotfile") + ( + cd + ln -svf "$dotfile" . + ) + done +} + +main