-
Notifications
You must be signed in to change notification settings - Fork 7
/
_set.bat
30 lines (25 loc) · 1.24 KB
/
_set.bat
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
@echo off
for %%a in ("%CD%") do set "PARENT_FOLDER=%%~nxa"
title %PARENT_FOLDER%
@REM set "PARENT_FOLDER=%CD%"
set GITBRANCH=
for /f %%I in ('git.exe branch --show-current 2^> NUL') do set GITBRANCH=%%I
@REM for /f %%I in ('git rev-parse --abbrev-ref HEAD 2^> NUL') do set GITBRANCH=%%I
@REM for /f "tokens=2" %%I in ('git.exe branch 2^> NUL ^| findstr /b "* "') do set GITBRANCH=%%I
@REM if "%GITBRANCH%" NEQ "" (
@REM set GITSTATUS=
@REM for /f %%I in ('git status --porcelain') do set GITSTATUS=*
@REM )
if "%ELEVATED%" == "" (
if "%GITBRANCH%" == "" (
prompt $E[30;46m$S$E[0m$E[30;46m%PARENT_FOLDER%$S$E[0m$E[36m$E[0m$S
) else (
prompt $E[30;46m$S$E[0m$E[30;46m%PARENT_FOLDER%$S$E[0m$E[36;43m$S$E[0m$E[30;43m%GITBRANCH%$S$E[0m$E[33m$E[0m$S
)
) else (
if "%GITBRANCH%" == "" (
prompt $E[30;41m$S$E[0m$E[30;41m%PARENT_FOLDER%$S$E[0m$E[31m$E[0m$S
) else (
prompt $E[30;41m$S$E[0m$E[30;41m%PARENT_FOLDER%$S$E[0m$E[31;43m$S$E[0m$E[30;43m%GITBRANCH%$S$E[0m$E[33m$E[0m$S
)
)