From 6fdcbde61a3edc48ddb971127f5222e92fc58062 Mon Sep 17 00:00:00 2001 From: Glen De Cauwsemaecker Date: Wed, 26 Mar 2014 14:18:34 +0100 Subject: [PATCH] Git setup works. --- .../coco-dev-setup/batch/localisation/en.coco | 5 ++ .../coco-dev-setup/batch/localisation/nl.coco | 5 ++ .../batch/scripts/github_setup.bat | 70 ++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/scripts/windows/coco-dev-setup/batch/localisation/en.coco b/scripts/windows/coco-dev-setup/batch/localisation/en.coco index 2d64651d3..4a85ed172 100755 --- a/scripts/windows/coco-dev-setup/batch/localisation/en.coco +++ b/scripts/windows/coco-dev-setup/batch/localisation/en.coco @@ -35,6 +35,11 @@ wait=When you're ready, press any key to continue... [process] path=Please give the full path of your CodeCombat git repository: + checkout=Please enter the full path where you want to install your CodeCombat environment + bashi=This installation requires Git Bash. + bashp64=Git bash is by default installed at 'C:\Program Files (x86)\Git'. + bashp32=Git bash is by default installed at 'C:\Program Files\Git'. + bashq=Please enter the full path where git bash is installed or just press enter if it's in the default location [error] path=That path already exists, are you sure you want to overwrite it? exist=That path doesn't exist. Please try again... diff --git a/scripts/windows/coco-dev-setup/batch/localisation/nl.coco b/scripts/windows/coco-dev-setup/batch/localisation/nl.coco index 6463f4f21..ba51e2974 100755 --- a/scripts/windows/coco-dev-setup/batch/localisation/nl.coco +++ b/scripts/windows/coco-dev-setup/batch/localisation/nl.coco @@ -35,6 +35,11 @@ wait=Wanneer je klaar bent, druk dan eender welke toets om verder te gaan... [process] path=Geef alsjeblieft het volledige pad van je CodeCombat git repository: + checkout=Geef alsjeblieft het volledige pad waar je de CodeCombat Ontwikkelings omgeving will installeren + bashi=Deze installatie maakt gebruik van Git Bash. + bashp64=Git bash is normaal geinstalleerd in 'C:\Program Files (x86)\Git'. + bashp32=Git bash is normaal geinstalleerd in 'C:\Program Files\Git'. + bashq=Geef alsjeblieft het volledige pad op van Git Bash of druk gewoon op enter indien je het pad niet gewijzigd heeft [error] path=Dat pad bestaat al, ben je zeker dat je het wil overschrijven? exist=Dat pad bestaat niet, probeer alsjeblieft opnieuw... diff --git a/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat b/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat index 82b4b3662..c03eac4d1 100755 --- a/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat +++ b/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat @@ -36,5 +36,73 @@ if "%result%"=="true" ( goto:exit_git_setup ) +goto:get_bash_path + +:get_bash_path + call get_local_text github-process-bashi + echo !github_process_bashi! + + if not defined install_system_bit ( + call print_dashed_seperator + call get_system_information + call print_dashed_seperator + ) + + if "%system_info_bit%"=="64" ( + call get_local_text github-process-bashp64 + echo !github_process_bashp64! + ) else ( + call get_local_text github-process-bashp32 + echo !github_process_bashp32! + ) + + call get_local_text github-process-bashq + set /p "git_bash_path=!github_process_bashq!: " + + if not defined git_bash_path ( + if "%system_info_bit%"=="64" ( + set "git_bash_path=C:\Program Files (x86)\Git" + ) else ( + set "git_bash_path=C:\Program Files\Git" + ) + goto:get_git_path + ) + + if not exist "%git_bash_path%" ( + call get_local_text error-exist + echo !error_exist! + call print_dashed_seperator + goto:get_bash_path + ) else ( + goto:get_git_path + ) +goto:eof + +:get_git_path + call print_dashed_seperator + call get_local_text github-process-checkout + set /p "repository_path=!github_process_checkout!: " + if exist !repository_path! ( + call get_local_text error-path + call ask_question "!error_path!" + if "!result!"=="false" ( + call print_dashed_seperator + goto:get_git_path + ) else ( + rmdir /s /q %repository_path% + ) + ) else ( + goto:git_checkout + ) +goto:eof + +:git_checkout + call print_dashed_seperator + set "git_app_path=%git_bash_path%\bin\git.exe" + "%git_app_path%" clone https://github.com/codecombat/codecombat.git "%repository_path%" + goto:exit_git_setup +goto:eof + :exit_git_setup - call print_dashed_seperator \ No newline at end of file + call print_dashed_seperator +goto:eof \ No newline at end of file