@@ -927,7 +927,7 @@ function link_current($versiondir) {
927
927
& " $env: COMSPEC " / c rmdir $currentdir
928
928
}
929
929
930
- & " $ env: COMSPEC " / c mklink / j $currentdir $ versiondir | out-null
930
+ New-Item - Path $currentdir - ItemType Junction - Value $ versiondir | Out-Null
931
931
attrib $currentdir + R / L
932
932
return $currentdir
933
933
}
@@ -1154,15 +1154,15 @@ function persist_data($manifest, $original_dir, $persist_dir) {
1154
1154
if (Test-Path $source ) {
1155
1155
Move-Item - Force $source " $source .original"
1156
1156
}
1157
- # we don't have persist data in the store, move the source to target, then create link
1157
+ # we don't have persist data in the store, move the source to target, then create link
1158
1158
} elseif (Test-Path $source ) {
1159
1159
# ensure target parent folder exist
1160
1160
ensure (Split-Path - Path $target ) | Out-Null
1161
1161
Move-Item $source $target
1162
- # we don't have neither source nor target data! we need to crate an empty target,
1163
- # but we can't make a judgement that the data should be a file or directory...
1164
- # so we create a directory by default. to avoid this, use pre_install
1165
- # to create the source file before persisting (DON'T use post_install)
1162
+ # we don't have neither source nor target data! we need to crate an empty target,
1163
+ # but we can't make a judgement that the data should be a file or directory...
1164
+ # so we create a directory by default. to avoid this, use pre_install
1165
+ # to create the source file before persisting (DON'T use post_install)
1166
1166
} else {
1167
1167
$target = New-Object System.IO.DirectoryInfo($target )
1168
1168
ensure $target | Out-Null
@@ -1171,11 +1171,11 @@ function persist_data($manifest, $original_dir, $persist_dir) {
1171
1171
# create link
1172
1172
if (is_directory $target ) {
1173
1173
# target is a directory, create junction
1174
- & " $ env: COMSPEC " / c " mklink /j `" $source `" `" $ target`" " | out-null
1174
+ New-Item - Path $source - ItemType Junction - Value $ target | Out-Null
1175
1175
attrib $source + R / L
1176
1176
} else {
1177
1177
# target is a file, create hard link
1178
- & " $ env: COMSPEC " / c " mklink /h `" $source `" `" $ target`" " | out-null
1178
+ New-Item - Path $source - ItemType HardLink - Value $ target | Out-Null
1179
1179
}
1180
1180
}
1181
1181
}
0 commit comments