Browse Source

fix(build.ps1): not required to be admin to run build in windows

mklink /D in windows requires elevated privilege (Runas Administrator),
'/J' to create a directory junction point runs with user privilege
use an explicit fully qualified path for junction target
rwindelz 12 years ago
parent
commit
45b4d6d194
1 changed files with 2 additions and 1 deletions
  1. 2 1
      build.ps1

+ 2 - 1
build.ps1

@@ -4,6 +4,7 @@ $env:GOPATH=$pwd.Path
 $SRC_DIR="$env:GOPATH/src"
 $SRC_DIR="$env:GOPATH/src"
 $ETCD_DIR="$SRC_DIR/$ETCD_PACKAGE"
 $ETCD_DIR="$SRC_DIR/$ETCD_PACKAGE"
 $env:ETCD_DIR="$SRC_DIR/$ETCD_PACKAGE"
 $env:ETCD_DIR="$SRC_DIR/$ETCD_PACKAGE"
+$env:ETCD_TARGET=$pwd.Path
 
 
 $ETCD_BASE=(Split-Path $ETCD_DIR -Parent)
 $ETCD_BASE=(Split-Path $ETCD_DIR -Parent)
 if(-not(test-path $ETCD_DIR)){
 if(-not(test-path $ETCD_DIR)){
@@ -11,7 +12,7 @@ if(-not(test-path $ETCD_DIR)){
 }
 }
 
 
 if(-not(test-path $ETCD_DIR )){
 if(-not(test-path $ETCD_DIR )){
-	cmd /c 'mklink /D "%ETCD_DIR%" ..\..\..\'
+	cmd /c 'mklink /J "%ETCD_DIR%" %ETCD_TARGET%'
 }
 }
 
 
 foreach($i in (ls third_party/*)){
 foreach($i in (ls third_party/*)){