Skip to content

mission control for agent skills

feat: prompt to star repo after install

Alvin3b11ff9e9295
diff --git a/scripts/install.ps1 b/scripts/install.ps1
index dab2818..08cd7a3 100644
--- a/scripts/install.ps1
+++ b/scripts/install.ps1
@@ -10,6 +10,21 @@ $Owner = "alvinunreal"
$Repo = "lazyskills"
$Binary = "lazyskills.exe"
+function Prompt-StarRepo {
+ if (-not (Get-Command gh -ErrorAction SilentlyContinue)) { return }
+ if (-not [Environment]::UserInteractive -or [Console]::IsInputRedirected) { return }
+
+ $answer = Read-Host "Would you like to star ${Owner}/${Repo} on GitHub? [Y/n]"
+ if ($answer -eq "" -or $answer -match "^(?i:y|yes)$") {
+ & gh repo star "${Owner}/${Repo}" | Out-Null
+ if ($LASTEXITCODE -eq 0) {
+ Write-Host "Starred ${Owner}/${Repo}."
+ } else {
+ Write-Warning "Could not star ${Owner}/${Repo} with GitHub CLI; continuing."
+ }
+ }
+}
+
$osArchitecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
$processorArchitecture = $env:PROCESSOR_ARCHITECTURE
@@ -68,6 +83,8 @@ try {
}
& (Join-Path $BinDir $Binary) version
+
+ Prompt-StarRepo
} finally {
Remove-Item -Path $tmp -Recurse -Force -ErrorAction SilentlyContinue
}
diff --git a/scripts/install.sh b/scripts/install.sh
index 92faf62..97fd500 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -46,6 +46,29 @@ need() {
need curl
need tar
+prompt_star_repo() {
+ if ! command -v gh >/dev/null 2>&1; then
+ return 0
+ fi
+
+ if [ ! -r /dev/tty ] || [ ! -w /dev/tty ]; then
+ return 0
+ fi
+
+ printf "Would you like to star ${OWNER}/${REPO} on GitHub? [Y/n] " >/dev/tty
+ IFS= read -r answer </dev/tty || return 0
+
+ case "$answer" in
+ ""|[Yy]|[Yy][Ee][Ss])
+ if gh repo star "${OWNER}/${REPO}" >/dev/null 2>&1; then
+ echo "Starred ${OWNER}/${REPO}."
+ else
+ echo "Note: could not star ${OWNER}/${REPO} with GitHub CLI; continuing." >&2
+ fi
+ ;;
+ esac
+}
+
OS="$(uname -s)"
ARCH="$(uname -m)"
@@ -120,3 +143,5 @@ case ":$PATH:" in
*":$BINDIR:"*) ;;
*) echo "Note: ${BINDIR} is not on your PATH." ;;
esac
+
+prompt_star_repo