Files
Rules/install.ps1
T
PapaTramp 7f8e7c0cb2 init-cursor: авто-bootstrap git на новом ПК, install.ps1 с Gitea.
Один вызов init-cursor настраивает SSH при необходимости и копирует rules в проект.
2026-06-18 11:23:30 +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.lan: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