-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCtx.ps1
More file actions
25 lines (21 loc) · 690 Bytes
/
Copy pathCtx.ps1
File metadata and controls
25 lines (21 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<#
==============================================================================
Cog: Context on Git - Windows PowerShell CLI Entry Point
Usage: .\Cog\Ctx.ps1 [COMMAND] [OPTIONS]
==============================================================================
#>
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
# Locate Python binary
$PythonBin = $null
foreach ($cmd in @("python", "python3", "py")) {
if (Get-Command $cmd -ErrorAction SilentlyContinue) {
$PythonBin = $cmd
break
}
}
if (-not $PythonBin) {
Write-Error "[Cog ERROR] Python was not found on your PATH."
exit 1
}
& $PythonBin "$ScriptDir/core/engine.py" @args
exit $LASTEXITCODE