Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.

Commit dd1e578

Browse files
author
Markus Perndorfer
committed
add windows version
1 parent 9f5f56d commit dd1e578

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ You current working dir is *not* modified, so you can fire any command without l
1111
## Installation
1212

1313
1. Clone or download this repo
14-
1. `chmod u+x ybp`
15-
1. put `ybp` somehwere on your `PATH`
16-
1. Never type `cd ../../../hybris/bin/platform` or `source setantenv.sh` again
14+
1. `chmod u+x ybp` (Linux / macOS only)
15+
1. put `ybp` / `ybp.bat` somehwere on your `PATH`
16+
1. Never type `cd ../../../hybris/bin/platform` or `source setantenv.sh` / `setantenv.bat` again
1717

1818
## Examples
1919

ybp.bat

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@setlocal ENABLEEXTENSIONS
2+
3+
@set current=%cd%
4+
@for /F %%I in ("%current%") do @set root=%%~dI
5+
6+
:loop
7+
@if EXIST "%current%\hybris\bin\platform\*" (
8+
@set platform=%current%\hybris\bin\platform
9+
)
10+
@call :dirname "%current%" current
11+
@IF NOT DEFINED platform IF NOT "%current%"=="%root%" goto :loop
12+
13+
@IF DEFINED platform (
14+
@cd "%platform%"
15+
@IF "%1"=="ant" (
16+
@call setantenv.bat
17+
)
18+
@%COMSPEC% /c %*
19+
) ELSE (
20+
echo Could not find hybris/bin/platform folder, will NOT execute '%*' 1>&2
21+
@EXIT /B 1
22+
)
23+
24+
@endlocal
25+
@goto:EOF
26+
27+
:dirname file varName
28+
@setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
29+
@SET _dir=%~dp1
30+
@SET _dir=%_dir:~0,-1%
31+
@endlocal & set %2=%_dir%
32+
@goto:EOF

0 commit comments

Comments
 (0)