-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplaycfg.bat
64 lines (52 loc) · 1.46 KB
/
playcfg.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@REM
@REM authors: @jlmanrique
@REM @eknowitsac
:begin
@echo off
echo _
echo _____ _ __
echo ^| __ \^| ^| / _^|
echo ^| ^|__) ^| ^| __ _ _ _ ___^| ^|_ __ _
echo ^| ___/^| ^|/ _` ^| ^| ^| ^|/ __^| _/ _` ^|
echo ^| ^| ^| ^| (_^| ^| ^|_^| ^| (__^| ^|^| (_^| ^|
echo ^|_^| ^|_^|\__,_^|\__, ^|\___^|_^| \__, ^|
echo __/ ^| __/ ^|
echo ^|___/ ^|___/
echo _
set pathToPlay=%~dp0
set defaultVersion=1.2.4
set firstPath=%firstPath%
if "%firstPath%"=="" goto setFirstPath
goto settings
:setFirstPath
set firstPath=%PATH%
:settings
if not "%1 %2"==" " goto commands
set versionToTest=%defaultVersion%
if not exist "%pathToPlay%\%defaultVersion%" echo dirError
if not exist "%pathToPlay%\%defaultVersion%\play.bat" echo playNotFound
set version=%defaultVersion%
goto setPath
:commands
if not "%1"=="version" goto usageError
if "%2"=="" echo usageError
set versionToTest=%2
if not exist "%pathToPlay%\%2" echo dirError
if not exist "%pathToPlay%\%2\play.bat" echo playNotFound
set version="%2"
:setPath
set PATH=%firstPath%;%pathToPlay%/%version%
goto success
:usageError
echo Usage: $playcfg version {version}
goto end
:dirError
echo Dir not found: %pathToPlay%\%versionToTest%
goto end
:playNotFound
echo Play framework not found at dir %pathToPlay%\%versionToTest%\play.bat
goto end
:success
echo Se ha configurado la version %version% de play
goto end
:end