Skip to content

Commit

Permalink
Make touch work with directories; Format scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkTiedemann committed Mar 25, 2019
1 parent 91d402b commit 93968b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tools/install_python.ps1
Expand Up @@ -5,6 +5,7 @@ if ($LastExitCode -eq 1603) {
$ErrorActionPreference = 'Stop'
msiexec.exe /x python.msi /qn "TARGETDIR=${PWD}\python" ALLUSERS=0
msiexec.exe /i python.msi /qn "TARGETDIR=${PWD}\python" ALLUSERS=0
} else {
}
else {
$Host.SetShouldExit($LastExitCode)
}
8 changes: 7 additions & 1 deletion tools/touch.ps1
@@ -1,3 +1,9 @@
param($item)
$ErrorActionPreference = 'Stop'
(Get-ChildItem $item).LastWriteTime = Get-Date
if (Test-Path -Type Container $item) {
$info = New-Object System.IO.DirectoryInfo($item)
}
else {
$info = New-Object System.IO.FileInfo($item)
}
$info.LastWriteTime = Get-Date
8 changes: 4 additions & 4 deletions tools/unpart.ps1
Expand Up @@ -4,9 +4,9 @@ $out = [System.Io.File]::OpenWrite($file)
$part = 1
$in = "${file}.${part}.part"
while (Test-Path $in) {
$buf = [System.IO.File]::ReadAllBytes($in)
$out.Write($buf, 0, $buf.Count)
$part += 1
$in = "${file}.${part}.part"
$buf = [System.IO.File]::ReadAllBytes($in)
$out.Write($buf, 0, $buf.Count)
$part += 1
$in = "${file}.${part}.part"
}
$out.close()

0 comments on commit 93968b1

Please sign in to comment.