Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
ln
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Penny committed Feb 23, 2012
1 parent 64bbe3d commit 6c1af82
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bin/ln
@@ -0,0 +1,26 @@
#!/bin/sh
# github.com/dansmith65/git/blob/master/contrib/workdir/git-new-workdir-win
# stackoverflow.com/questions/8409024
#
# TESTS
# ln "/c/a/git.exe" "/c/a/git-add.exe"
# ln -s "/c/a/b" "/c/a/b-link"
# ln -s "/c/a/git git.exe" "/c/a/git git-add.exe"
# ln -s "/c/a/git.exe" "$HOME/git-add.exe"
# ln -s "/c/a/git.exe" "/c/a/git-add.exe"
# ln -s "C:\a\git.exe" "C:\a\git-add.exe"

for i in 0 1
do
arg="${BASH_ARGV[$i]}"
dn=$(cd "$(dirname "$arg")"; pwd -W)
bn=$(basename "$arg")
paths+="\"$dn/$bn\" "
done

if test -d "$2"
then is_dir='/d'
fi

# ".exe" is required
cmd.exe /c "mklink $is_dir $paths"

0 comments on commit 6c1af82

Please sign in to comment.