diff options
Diffstat (limited to '')
-rwxr-xr-x | link.sh (renamed from link.zsh) | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/link.zsh b/link.sh index a0a9e7aa..0f1f49aa 100755 --- a/link.zsh +++ b/link.sh @@ -1,10 +1,10 @@ -#!/usr/bin/env zsh -set -o errexit -o nounset -o pipefail +#!/bin/sh +set -e -u -if [[ $# -eq 1 ]]; then - linkPath="$1" +if [ $# -eq 1 ]; then + linkPath=$1 filePath="$PWD/home/${linkPath#$HOME/}" - [[ ! -f "$filePath" ]] + [ ! -f "$filePath" ] mkdir -p "$(dirname "$filePath")" mv "$linkPath" "$filePath" fi @@ -13,6 +13,6 @@ find home -type f | while read -r findPath; do filePath="$PWD/$findPath" linkPath="$HOME/${findPath#home/}" mkdir -p "$(dirname "$linkPath")" - [[ ( -f "$linkPath" && -L "$linkPath" ) || ! -f "$linkPath" ]] + [ \( -f "$linkPath" -a -L "$linkPath" \) -o ! -f "$linkPath" ] ln -s -f "$filePath" "$linkPath" done |