4caedb3074
Set-GitRemotes переименует origin по хосту; SSH config для .ru через LAN IP.
37 lines
1.1 KiB
PowerShell
37 lines
1.1 KiB
PowerShell
#Requires -Version 5.1
|
||
<#
|
||
.SYNOPSIS
|
||
Первая загрузка с Gitea: clone Rules и запуск init-cursor в текущем проекте.
|
||
|
||
.EXAMPLE
|
||
cd C:\path\to\your-repo
|
||
irm https://git.kalinamall.ru/PapaTramp/Rules/raw/branch/main/install.ps1 | iex
|
||
#>
|
||
[CmdletBinding()]
|
||
param(
|
||
[Parameter(ValueFromRemainingArguments = $true)]
|
||
[object[]]$InitCursorArgs
|
||
)
|
||
|
||
Set-StrictMode -Version Latest
|
||
$ErrorActionPreference = 'Stop'
|
||
|
||
$rulesDest = Join-Path $HOME 'CursorRules'
|
||
$httpsUrl = 'https://git.kalinamall.ru/PapaTramp/Rules.git'
|
||
$sshUrl = 'ssh://git@git.kalinamall.ru:2222/PapaTramp/Rules.git'
|
||
|
||
if (-not (Test-Path (Join-Path $rulesDest '.git'))) {
|
||
Write-Host '[*] Cloning Rules from Gitea (HTTPS, login once if asked)...' -ForegroundColor Cyan
|
||
if (Test-Path -LiteralPath $rulesDest) {
|
||
throw "Path exists and is not a git repo: $rulesDest"
|
||
}
|
||
git clone --depth 1 $httpsUrl $rulesDest
|
||
if ($LASTEXITCODE -ne 0) {
|
||
throw 'git clone failed'
|
||
}
|
||
Write-Host "[+] Cloned to $rulesDest" -ForegroundColor Green
|
||
}
|
||
|
||
. (Join-Path $rulesDest 'init-cursor.ps1')
|
||
init-cursor @InitCursorArgs
|