-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgreens.cmd
More file actions
37 lines (31 loc) · 1.08 KB
/
Copy pathgreens.cmd
File metadata and controls
37 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@echo off
REM greens - Windows launcher (Windows 10/11)
REM Runs sync.sh via Git Bash (bundled with Git for Windows)
REM
REM Prerequisites: Git for Windows (https://git-scm.com/download/win)
setlocal EnableDelayedExpansion
REM Find Git Bash
set "GITBASH="
for %%p in (
"%ProgramFiles%\Git\bin\bash.exe"
"%ProgramFiles(x86)%\Git\bin\bash.exe"
"%LocalAppData%\Programs\Git\bin\bash.exe"
) do (
if exist %%p set "GITBASH=%%~p"
)
REM Fallback: check PATH (covers Scoop, Chocolatey, custom installs)
if "!GITBASH!"=="" (
for /f "delims=" %%g in ('where bash.exe 2^>NUL') do set "GITBASH=%%g"
)
if "!GITBASH!"=="" (
echo ERROR: Git Bash not found.
echo Install Git for Windows: https://git-scm.com/download/win
echo Or install via: winget install Git.Git
exit /b 1
)
REM Get the directory where this script lives, convert to forward slashes for bash
set "SCRIPT_DIR=%~dp0"
if "!SCRIPT_DIR:~-1!"=="\" set "SCRIPT_DIR=!SCRIPT_DIR:~0,-1!"
set "SCRIPT_DIR=!SCRIPT_DIR:\=/!"
REM Run sync.sh with all arguments
"!GITBASH!" --login -c "cd '!SCRIPT_DIR!' && bash sync.sh %*"