fix: standardization and auto-install support

This commit is contained in:
Haitao Pan 2026-02-03 02:55:14 +08:00
parent 90c9dd2622
commit 8898b12ab0
3 changed files with 17 additions and 5 deletions

View File

@ -10,7 +10,15 @@
VERSION="main" VERSION="main"
DOMAIN="$(hostname)" DOMAIN="$(hostname)"
# Smart parameter parsing # Handle flags
AUTO_YES=false
while [[ "$1" =~ ^- ]]; do
case "$1" in
-y|--yes) AUTO_YES=true; shift ;;
*) break ;;
esac
done
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
# if $1 looks like a version/branch (main, master, v1.0, etc.) # if $1 looks like a version/branch (main, master, v1.0, etc.)
if [[ "$1" == "main" || "$1" == "master" || "$1" == v[0-9]* ]]; then if [[ "$1" == "main" || "$1" == "master" || "$1" == v[0-9]* ]]; then
@ -48,8 +56,12 @@ fi
# Clone or Update # Clone or Update
if [ -d "${INSTALL_DIR}" ]; then if [ -d "${INSTALL_DIR}" ]; then
echo -e "${BLUE}Directory ${INSTALL_DIR} already exists.${NC}" echo -e "${BLUE}Directory ${INSTALL_DIR} already exists.${NC}"
read -p "Overwrite? (y/N) " -n 1 -r if [ "$AUTO_YES" = true ]; then
echo REPLY="y"
else
read -p "Overwrite? (y/N) " -n 1 -r
echo
fi
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf "${INSTALL_DIR}" rm -rf "${INSTALL_DIR}"
if ! git clone -b "${VERSION}" "${REPO_URL}" "${INSTALL_DIR}"; then if ! git clone -b "${VERSION}" "${REPO_URL}" "${INSTALL_DIR}"; then

View File

@ -3,7 +3,7 @@
import React from 'react' import React from 'react'
import { BellRing, Compass, Layers, Sparkles, LayoutDashboard, type LucideIcon, PanelLeftClose, PanelLeftOpen, EyeOff } from 'lucide-react' import { BellRing, Compass, Layers, Sparkles, LayoutDashboard, type LucideIcon, PanelLeftClose, PanelLeftOpen, EyeOff } from 'lucide-react'
import { QueryLanguage, TopologyMode } from '../store/urlState' import { QueryLanguage, TopologyMode } from '../store/urlState'
import { SidebarHeader, SidebarContent } from '@/components/layout/SidebarRoot' import { SidebarHeader, SidebarContent } from '../../layout/SidebarRoot'
interface InsightSidebarContentProps { interface InsightSidebarContentProps {
topologyMode: TopologyMode topologyMode: TopologyMode

View File

@ -2,7 +2,7 @@
import React from 'react' import React from 'react'
import { QueryLanguage, TopologyMode } from '../store/urlState' import { QueryLanguage, TopologyMode } from '../store/urlState'
import { SidebarRoot, SidebarHeader, SidebarContent } from '@/components/layout/SidebarRoot' import { SidebarRoot, SidebarHeader, SidebarContent } from '../../layout/SidebarRoot'
import { InsightSidebarContent } from './InsightSidebarContent' import { InsightSidebarContent } from './InsightSidebarContent'
interface SidebarProps { interface SidebarProps {