Skip to content

Instantly share code, notes, and snippets.

@mvalipour
Last active September 8, 2018 08:36
Show Gist options
  • Save mvalipour/9445ed7bcf951ba7ae6a to your computer and use it in GitHub Desktop.
Save mvalipour/9445ed7bcf951ba7ae6a to your computer and use it in GitHub Desktop.
Install HubFlow on windows
@echo off
setlocal
rem ===================
rem Set GIT_HOME
rem ===================
rem Read the Git for Windows installation path from the Registry.
:REG_QUERY
for /f "skip=2 delims=: tokens=1*" %%a in ('reg query "HKLM\SOFTWARE%WOW%\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1" /v InstallLocation 2^> nul') do (
for /f "tokens=3" %%z in ("%%a") do (
set GIT=%%z:%%b
)
)
if "%GIT%"=="" (
if "%WOW%"=="" (
rem Assume we are on 64-bit Windows, so explicitly read the 32-bit Registry.
set WOW=\Wow6432Node
goto REG_QUERY
)
)
if "%GIT%"=="" (
echo [ERROR] Git is not installed!
goto end
)
rem SETX GIT_HOME /M "%GIT%"
echo GIT_HOME is : '%GIT%'
rem ===================
rem Create temp folder
rem ===================
set DIR_PATH=%TEMP%\hubflow_install\%RANDOM%
echo %DIR_PATH%
mkdir %DIR_PATH%
cd %DIR_PATH%
rem ===================
rem Installation
rem ===================
git clone https://github.com/mvalipour/hubflow
cd hubflow
git submodule init
git submodule update
call install-win.cmd "%GIT%" install
rem ===================
rem clean up
rem ===================
cd %HOME%
rd /s /q %DIR_PATH%
echo installation folder removed: %DIR_PATH%
rem upgrade
git hf upgrade
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment