@castlekit/castle 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/install.sh +17 -0
- package/package.json +1 -1
package/install.sh
CHANGED
|
@@ -553,6 +553,20 @@ install_castle() {
|
|
|
553
553
|
|
|
554
554
|
local resolved_version=""
|
|
555
555
|
resolved_version="$(npm view "${install_spec}" version 2>/dev/null || true)"
|
|
556
|
+
|
|
557
|
+
# Check if this version is already installed
|
|
558
|
+
local installed_version=""
|
|
559
|
+
installed_version="$(npm list -g @castlekit/castle --depth=0 --json 2>/dev/null | node -e "
|
|
560
|
+
let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{
|
|
561
|
+
try{const j=JSON.parse(d);console.log(j.dependencies?.['@castlekit/castle']?.version||'')}catch{}
|
|
562
|
+
})
|
|
563
|
+
" 2>/dev/null || true)"
|
|
564
|
+
|
|
565
|
+
if [[ -n "$resolved_version" && "$installed_version" == "$resolved_version" ]]; then
|
|
566
|
+
echo -e "${SUCCESS}✓${NC} Castle ${INFO}${resolved_version}${NC} already installed"
|
|
567
|
+
return 0
|
|
568
|
+
fi
|
|
569
|
+
|
|
556
570
|
if [[ -n "$resolved_version" ]]; then
|
|
557
571
|
echo -e "${WARN}→${NC} Installing Castle ${INFO}${resolved_version}${NC}..."
|
|
558
572
|
else
|
|
@@ -642,6 +656,9 @@ main() {
|
|
|
642
656
|
# Step 6: Run onboarding
|
|
643
657
|
if [[ "$NO_ONBOARD" == "1" ]]; then
|
|
644
658
|
echo -e "Skipping setup (requested). Run ${INFO}castle setup${NC} later."
|
|
659
|
+
elif [[ -f "$HOME/.castle/castle.json" ]]; then
|
|
660
|
+
echo -e "${SUCCESS}✓${NC} Castle is already configured"
|
|
661
|
+
echo -e "${MUTED}Run ${INFO}castle setup${NC} to reconfigure.${NC}"
|
|
645
662
|
else
|
|
646
663
|
if [[ -r /dev/tty && -w /dev/tty ]]; then
|
|
647
664
|
echo -e "Starting setup..."
|