Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide activation script for Windows cmd #479

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text eol=lf
*.bat text eol=crlf
30 changes: 30 additions & 0 deletions activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@echo off

REM ------------------------------------------------------------------------------
REM
REM This is the `git-subrepo` cmd initialization script.
REM
REM This script turns on the `git-subrepo` Git subcommand for Windows command-line
REM
REM Just execute inside cmd.exe or another batch file:
REM
REM path\to\git-subrepo\activate.bat
REM
REM ------------------------------------------------------------------------------


where git.exe >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo could not find git in PATH
goto:end
)

if NOT "%GIT_SUBREPO_ROOT%" == "%~dp0" (
set "GIT_SUBREPO_ROOT=%~dp0"
set "PATH=%~dp0lib;%PATH%"
)
for /F "tokens=* USEBACKQ" %%F IN (`git subrepo --version`) do (
echo using version %%F in %GIT_SUBREPO_ROOT%
)

:end