-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
82 lines (66 loc) · 3 KB
/
Copy pathinstall
File metadata and controls
82 lines (66 loc) · 3 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# dev-pomogator installer
#
# Recommended (cross-platform, one command everywhere):
# npx github:stgmt/dev-pomogator --claude --all
# npx github:stgmt/dev-pomogator --cursor --all
# npx github:stgmt/dev-pomogator --cursor --claude --all
#
# Alternative (shell-pipe):
# Windows: irm https://raw.githubusercontent.com/stgmt/dev-pomogator/main/install | iex
# Linux/Mac: curl -fsSL https://raw.githubusercontent.com/stgmt/dev-pomogator/main/install | bash
# With target: $env:TARGET="claude"; irm ... | iex / TARGET=claude curl ... | bash
echo --% > /dev/null ; : <<'POWERSHELL_SECTION'
# --- PowerShell section (bash skips via heredoc) ---
$ErrorActionPreference = 'Stop'
$repo = "https://github.com/stgmt/dev-pomogator.git"
$tmpDir = Join-Path $env:TEMP "dev-pomogator-$(Get-Random)"
$originalDir = Get-Location
switch ($env:TARGET) {
"all" { $target = "--cursor --claude"; $targetName = "Cursor + Claude Code" }
"claude" { $target = "--claude"; $targetName = "Claude Code" }
default { $target = "--cursor"; $targetName = "Cursor" }
}
Write-Host "Installing dev-pomogator for $targetName..." -ForegroundColor Cyan
Write-Host " Cloning repository..." -ForegroundColor Gray
cmd /c "git clone --depth 1 $repo $tmpDir 2>nul"
if (-not (Test-Path $tmpDir)) {
Write-Host "Failed to clone repository" -ForegroundColor Red
exit 1
}
Set-Location $tmpDir
Write-Host " Installing dependencies..." -ForegroundColor Gray
cmd /c "npm install 2>nul >nul"
if ($LASTEXITCODE -ne 0) { Write-Host "npm install failed" -ForegroundColor Red; Set-Location $originalDir; Remove-Item -Recurse -Force $tmpDir -ErrorAction SilentlyContinue; exit 1 }
Write-Host " Building..." -ForegroundColor Gray
cmd /c "npm run build 2>nul >nul"
if ($LASTEXITCODE -ne 0) { Write-Host "npm run build failed" -ForegroundColor Red; Set-Location $originalDir; Remove-Item -Recurse -Force $tmpDir -ErrorAction SilentlyContinue; exit 1 }
Set-Location $originalDir
Write-Host " Running installer..." -ForegroundColor Gray
node "$tmpDir\dist\index.cjs" $target.Split(' ') --all
Remove-Item -Recurse -Force $tmpDir -ErrorAction SilentlyContinue
$env:TARGET = $null
Write-Host "Done!" -ForegroundColor Green
return
POWERSHELL_SECTION
# --- Bash section (PowerShell never reaches due to return) ---
set -e
for cmd in git node npm; do
command -v "$cmd" >/dev/null 2>&1 || { echo "Error: $cmd is required but not found"; exit 1; }
done
REPO="https://github.com/stgmt/dev-pomogator.git"
TMP_DIR=$(mktemp -d)
trap 'rm -rf "$TMP_DIR"' EXIT
ORIGINAL_DIR=$(pwd)
case "$TARGET" in
all) TARGET_FLAG="--cursor --claude"; TARGET_NAME="Cursor + Claude Code" ;;
claude) TARGET_FLAG="--claude"; TARGET_NAME="Claude Code" ;;
*) TARGET_FLAG="--cursor"; TARGET_NAME="Cursor" ;;
esac
echo "Installing dev-pomogator for $TARGET_NAME..."
git clone --depth 1 "$REPO" "$TMP_DIR" > /dev/null 2>&1
cd "$TMP_DIR"
npm install --silent > /dev/null 2>&1
npm run build --silent > /dev/null 2>&1
cd "$ORIGINAL_DIR"
node "$TMP_DIR/dist/index.cjs" $TARGET_FLAG --all
echo "Done!"