Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions install/bash/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,24 @@ fi

PLAIN_FORGE_INSTALLED=false
if [[ ! "${INSTALL_PLAIN_FORGE:-}" =~ ^[Nn]$ ]]; then
if command -v npx &> /dev/null; then
npx plain-forge install < /dev/tty
PLAIN_FORGE_INSTALLED=true
# A stale nvm/volta/asdf shim can make npx resolvable without a working
# Node.js behind it, so verify node actually runs before invoking npx.
if command -v npx &> /dev/null && node --version &> /dev/null; then
# The install must not abort the rest of the setup if plain-forge
# fails (set -e is active), so run it inside the condition.
if npx plain-forge install < /dev/tty; then
PLAIN_FORGE_INSTALLED=true
else
echo -e "${GRAY}plain-forge installation failed. You can retry later with:${NC}"
echo -e " npx plain-forge install"
fi
echo ""
else
echo -e "${GRAY}npx not found. Install Node.js, then run:${NC}"
echo -e " npx plain-forge install"
echo -e " ${GRAY}plain-forge brings codeplain's agentic skills to your coding agent,${NC}"
echo -e " ${GRAY}but installing it requires Node.js, which was not found on this machine.${NC}"
echo ""
echo -e " ${GRAY}If you want it, install Node.js and then run:${NC}"
echo -e " ${WHITE}${BOLD}npx plain-forge install${NC}"
echo ""
fi
fi
Expand Down
36 changes: 31 additions & 5 deletions install/powershell/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,39 @@ if ($nonInteractive) {

$plainForgeInstalled = $false
if ($installPlainForge -notmatch '^[Nn]$') {
if (Get-Command npx -ErrorAction SilentlyContinue) {
npx plain-forge install
$plainForgeInstalled = $true
# A stale version-manager shim can make npx resolvable without a working
# Node.js behind it, so verify node actually runs before invoking npx.
$nodeWorks = $false
if ((Get-Command node -ErrorAction SilentlyContinue) -and (Get-Command npx -ErrorAction SilentlyContinue)) {
try {
& node --version *> $null
$nodeWorks = ($LASTEXITCODE -eq 0)
} catch {
$nodeWorks = $false
}
}
if ($nodeWorks) {
# A plain-forge failure must not abort the rest of the setup
# ($ErrorActionPreference is 'Stop').
try {
npx plain-forge install
if ($LASTEXITCODE -eq 0) {
$plainForgeInstalled = $true
}
} catch {
# fall through to the retry hint below
}
if (-not $plainForgeInstalled) {
Write-Host "${GRAY}plain-forge installation failed. You can retry later with:${NC}"
Write-Host " npx plain-forge install"
}
Write-Host ""
} else {
Write-Host "${GRAY}npx not found. Install Node.js, then run:${NC}"
Write-Host " npx plain-forge install"
Write-Host " ${GRAY}plain-forge brings codeplain's agentic skills to your coding agent,${NC}"
Write-Host " ${GRAY}but installing it requires Node.js, which was not found on this machine.${NC}"
Write-Host ""
Write-Host " ${GRAY}If you want it, install Node.js and then run:${NC}"
Write-Host " ${WHITE}${BOLD}npx plain-forge install${NC}"
Write-Host ""
}
}
Expand Down
Loading