Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74e4aee

Browse files
authored
Prevent upload script uploading from the wrong directory (GH-7953)
1 parent 4a8b037 commit 74e4aee

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Tools/msi/uploadrelease.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ param(
3939
if (-not $build) { throw "-build option is required" }
4040
if (-not $user) { throw "-user option is required" }
4141

42+
if (-not ((Test-Path "$build\win32\python-*.exe") -or (Test-Path "$build\amd64\python-*.exe"))) {
43+
throw "-build argument does not look like a 'build' directory"
44+
}
45+
4246
function find-putty-tool {
4347
param ([string]$n)
4448
$t = gcm $n -EA 0
@@ -57,14 +61,16 @@ $p = gci -r "$build\python-*.exe" | `
5761
"Uploading version $($p[0]) $($p[1])"
5862
" from: $build"
5963
" to: $($server):$target/$($p[0])"
60-
" using: $plink and $pscp"
6164
""
6265

6366
if (-not $skipupload) {
6467
# Upload files to the server
6568
$pscp = find-putty-tool "pscp"
6669
$plink = find-putty-tool "plink"
6770

71+
"Upload using $pscp and $plink"
72+
""
73+
6874
pushd $build
6975
$doc = gci python*.chm, python*.chm.asc
7076
popd

0 commit comments

Comments
 (0)