Files
Rules/install.ps1
T
PapaTramp 4caedb3074 Remotes: kalinamall, home, github по SSH (.ru); origin убран.
Set-GitRemotes переименует origin по хосту; SSH config для .ru через LAN IP.
2026-06-18 11:34:03 +10:00

37 lines
1.1 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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