-
Notifications
You must be signed in to change notification settings - Fork 101
/
BuildTestConfig.cmd
57 lines (48 loc) · 1.5 KB
/
BuildTestConfig.cmd
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
@REM Copyright (c) Microsoft Corporation. All rights reserved.
@REM Licensed under the MIT license.
@echo off
setlocal
if "%~1" equ "/?" goto :Usage
if "%~1" equ "-?" goto :Usage
if "%~1" equ "?" goto :Usage
if "%~1" equ "/h" goto :Usage
if "%~1" equ "-h" goto :Usage
set TEST_SETTING_FILE_DIR=%~dp0\secrets
if NOT EXIST "%TEST_SETTING_FILE_DIR%" (
md "%TEST_SETTING_FILE_DIR%" || (
echo Error creating directory %TEST_SETTING_FILE_DIR%
exit /b 1
)
)
set TEST_SETTING_FILE_NAME=%TEST_SETTING_FILE_DIR%\TestConfiguration.ts
if EXIST "%TEST_SETTING_FILE_NAME%" (
echo Clearing values from settings file.
echo. > "%TEST_SETTING_FILE_NAME%" || (
echo Error creating file %TEST_SETTING_FILE_NAME%
exit /b 1
)
)
@echo import { Settings } from "../tests/Settings" > "%TEST_SETTING_FILE_NAME%"
:NextArg
if "%~1" == "" (
goto :eof
)
for /f "tokens=1,2 delims=:" %%I in ("%~1") do (
echo Setting Settings.%%I = "%%J"
echo Settings.%%I = "%%J"; >> "%TEST_SETTING_FILE_NAME%"
)
shift
goto :NextArg
exit /b 0
:Usage
@echo off
echo.
echo Usage: %~n0 ^<ParamName^>:^<Value^>
echo.
echo Writes any ^<ParamName^>:^<Value^> pair to the test settings file for JavaScript bindings tests.
echo.
echo The file will be erased before new values are added.
echo.
echo Current settings available are: [SpeechSubscriptionKey:^<key^>] [SpeechRegion:^<region^>] [LuisSubscriptionKey:^<LuisKey^>] [LuisRegion:^<region^>] [LuisAppId:^<LuisAppId^>] [VoiceSignatureEnrollmentKey:^VoiceSignatureEnrollmentKey^>]
echo.
exit /b 1