added
This commit is contained in:
1 parent
f5aebfaf77
commit
87cc362513
1541 files changed
+25537
-2
No files matched your search
@@ -0,0 +1,26 @@
|
||||
param(
|
||||
[string]$PythonExecutable = "C:\Users\edsoe\AppData\Local\Programs\Python\Python313\python.exe"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$repositoryRoot = (Resolve-Path (Join-Path $scriptDirectory "..\..")).Path
|
||||
$publisher = Join-Path $scriptDirectory "publish_future_map_insights.py"
|
||||
$logDirectory = Join-Path $repositoryRoot "logs"
|
||||
$logFile = Join-Path $logDirectory ("future-map-insights-hub-" + (Get-Date -Format "yyyy-MM-dd") + ".log")
|
||||
|
||||
New-Item -ItemType Directory -Path $logDirectory -Force | Out-Null
|
||||
|
||||
$started = Get-Date -Format "yyyy-MM-dd HH:mm:ss zzz"
|
||||
"[$started] Starting Future Map Insights Hub publication." | Set-Content -LiteralPath $logFile -Encoding utf8
|
||||
|
||||
$publisherOutput = & $PythonExecutable $publisher 2>&1
|
||||
$exitCode = $LASTEXITCODE
|
||||
$publisherOutput | Add-Content -LiteralPath $logFile -Encoding utf8
|
||||
|
||||
$finished = Get-Date -Format "yyyy-MM-dd HH:mm:ss zzz"
|
||||
"[$finished] Finished with exit code $exitCode." | Add-Content -LiteralPath $logFile -Encoding utf8
|
||||
|
||||
if ($exitCode -ne 0) {
|
||||
throw "Future Map Insights Hub publication failed with exit code $exitCode. See $logFile"
|
||||
}
|
||||
Reference in new issue
Block a user