MCPcopy Index your code
hub / github.com/BasicProtein/AugmentCode-Free / _create_startup_scripts

Method _create_startup_scripts

build.py:560–619  ·  view source on GitHub ↗

Create platform-specific startup scripts

(self, portable_dir: Path)

Source from the content-addressed store, hash-verified

558 return False
559
560 def _create_startup_scripts(self, portable_dir: Path) -> None:
561 """Create platform-specific startup scripts"""
562
563 # Windows batch script
564 win_script = f'''@echo off
565chcp 65001 >nul
566title {PROJECT_NAME} v{VERSION}
567echo.
568echo ========================================
569echo {PROJECT_NAME} v{VERSION}
570echo {DESCRIPTION}
571echo Author: {AUTHOR}
572echo ========================================
573echo.
574python --version >nul 2>&1
575if errorlevel 1 (
576 echo ERROR: Python not found!
577 echo Please install Python 3.7+ from https://python.org
578 pause
579 exit /b 1
580)
581echo Starting GUI...
582python main.py
583pause
584'''
585
586 with open(portable_dir / f'Start-{PROJECT_NAME}.bat', 'w', encoding='utf-8') as f:
587 f.write(win_script)
588
589 # Unix shell script
590 unix_script = f'''#!/bin/bash
591echo "========================================"
592echo " {PROJECT_NAME} v{VERSION}"
593echo " {DESCRIPTION}"
594echo " Author: {AUTHOR}"
595echo "========================================"
596echo
597
598if ! command -v python3 &> /dev/null && ! command -v python &> /dev/null; then
599 echo "ERROR: Python not found!"
600 echo "Please install Python 3.7+"
601 exit 1
602fi
603
604PYTHON_CMD="python3"
605if ! command -v python3 &> /dev/null; then
606 PYTHON_CMD="python"
607fi
608
609echo "Starting GUI..."
610$PYTHON_CMD main.py
611'''
612
613 script_path = portable_dir / f'start-{PROJECT_NAME.lower()}.sh'
614 with open(script_path, 'w', encoding='utf-8') as f:
615 f.write(unix_script)
616
617 # Make executable on Unix systems

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected