-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.ps1
More file actions
59 lines (49 loc) · 1.76 KB
/
install.ps1
File metadata and controls
59 lines (49 loc) · 1.76 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[CmdletBinding()]
param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$InstallerArgs
)
$ErrorActionPreference = "Stop"
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$installer = Join-Path $scriptDir "scripts/install_codex_integration.py"
function Show-WrapperHelp {
@"
ix-codex-plugin installer wrapper
Usage:
.\install.ps1 --repo C:\path\to\project [--plugin] [--hooks] [--mode copy|symlink] [--force]
.\install.ps1 --home [--plugin] [--hooks] [--mode copy|symlink] [--force]
Examples:
.\install.ps1 --repo C:\path\to\project --plugin
.\install.ps1 --repo C:\path\to\project --plugin --hooks
.\install.ps1 --repo C:\path\to\project --plugin --hooks --mode symlink
.\install.ps1 --home --plugin --hooks
Notes:
- If neither --plugin nor --hooks is passed, the installer defaults to --plugin.
- This wrapper forwards all arguments to scripts/install_codex_integration.py.
"@
}
if (Get-Command py -ErrorAction SilentlyContinue) {
if ($InstallerArgs.Count -gt 0 -and ($InstallerArgs[0] -eq "--help" -or $InstallerArgs[0] -eq "-h")) {
Show-WrapperHelp
""
}
& py -3 $installer @InstallerArgs
exit $LASTEXITCODE
}
if (Get-Command python -ErrorAction SilentlyContinue) {
if ($InstallerArgs.Count -gt 0 -and ($InstallerArgs[0] -eq "--help" -or $InstallerArgs[0] -eq "-h")) {
Show-WrapperHelp
""
}
& python $installer @InstallerArgs
exit $LASTEXITCODE
}
if (Get-Command python3 -ErrorAction SilentlyContinue) {
if ($InstallerArgs.Count -gt 0 -and ($InstallerArgs[0] -eq "--help" -or $InstallerArgs[0] -eq "-h")) {
Show-WrapperHelp
""
}
& python3 $installer @InstallerArgs
exit $LASTEXITCODE
}
Write-Error "Python 3 is required to run the installer."