-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2615e13
commit df90387
Showing
24 changed files
with
142 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,11 @@ | |
|
||
- 注释行(comment) | ||
|
||
以`#`开头的行. | ||
以`#`或者`;`开头的行. | ||
|
||
- 无效行(invalid) | ||
|
||
不含`=` 或者 值为空. | ||
不含`=` 或者 键值为空. | ||
|
||
- 段(section) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
::@author FB | ||
::@version 0.1.0 | ||
::@version 0.2.0 | ||
|
||
::数据结构为Object | ||
::仅支持一级段 | ||
::数据结构为Map | ||
::仅支持一级段, 由%包裹的变量不会被展开 | ||
|
||
::写入配置文件 | ||
:: 参数1: 实例名称 | ||
:: 参数2: 配置文件 | ||
|
||
::Script:Object.List.CMD:: | ||
::Script:Object.ListSub.CMD:: | ||
::Script:Object.ListAll.CMD:: | ||
::Script:Map.Child.CMD:: | ||
::Script:Map.List.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
ECHO # This is an autogenerated file. Do not edit this file directly.>"%~2" | ||
CALL Object.List.CMD "%~1" "{0}={1}">>"%~2" | ||
CALL Map.List.CMD "%~1" "{0}={1}">>"%~2" | ||
FOR /F "usebackq delims=" %%A IN ( | ||
`CALL Object.ListSub.CMD "%~1" "{0}"` | ||
`CALL Map.Child.CMD "%~1" "{0}"` | ||
) DO ( | ||
ECHO.>>"%~2" | ||
CALL ECHO [%%~A]>>"%~2" | ||
CALL Object.ListAll.CMD "%~1.%%~A" "{0}={1}">>"%~2" | ||
CALL Map.List.CMD "%~1.%%~A" "{0}={1}">>"%~2" | ||
) | ||
EXIT /B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
::@author FB | ||
::@version 0.1.0 | ||
|
||
::Powershell设置环境变量 | ||
::设置环境变量 | ||
:: 参数1: 环境变量名 | ||
:: 参数2: 环境变量值 | ||
:: 参数3: 作用域(MACHINE/USER/PROCESS) | ||
:: 参数3: 作用域(MACHINE/USER) | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
@ECHO OFF | ||
SETLOCAL | ||
SET "@NAME=%~1" & SET "@VALUE=%~2" & SET "@TARGET=%~3" | ||
Powershell.EXE -Command "& { $ErrorActionPreference='Ignore'; [Environment]::SetEnvironmentVariable(${Env:@NAME},${Env:@VALUE},${Env:@TARGET}); Exit -Not $? }" | ||
Powershell.EXE -Command "& { [Environment]::SetEnvironmentVariable(${Env:@NAME},${Env:@VALUE},${Env:@TARGET}); Exit -Not $? }" | ||
ENDLOCAL | ||
EXIT /B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::遍历子项 | ||
:: 参数1: 实例名称 | ||
:: 参数2: 输出格式({0}子项占位符) | ||
:: 输出: 格式化后的多行字符串 | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
@ECHO OFF | ||
SETLOCAL | ||
SET "@PREFIX=%~1." & SET "@FMT=%~2" | ||
Powershell.EXE -Command "& { Get-Item Env:${Env:@PREFIX}@CHILD -ErrorAction Ignore | ForEach-Object Value | ForEach-Object {$PSItem.Split(';',[StringSplitOptions]::RemoveEmptyEntries)} | ForEach-Object {${Env:@FMT} -f $PSItem,''}; Exit -Not $? }" | ||
ENDLOCAL | ||
EXIT /B |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
::@author FB | ||
::@version 0.1.0 | ||
::@version 0.2.0 | ||
|
||
::Ïú»Ù | ||
:: ²ÎÊý1: ʵÀýÃû³Æ | ||
|
||
::Script:Map.Destroy.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
CALL SET "@=%%%~1.@MAP%%" | ||
FOR %%A IN (%@%) DO ( | ||
SET "%~1.%%~A=" | ||
) | ||
SET "%~1.@MAP=" | ||
CALL SET "@=%%%~1.@LIST%%" | ||
FOR %%A IN (%@%) DO SET "%~1.%%~A=" | ||
CALL SET "@=%%%~1.@CHILD%%" | ||
FOR %%A IN (%@%) DO CALL Map.Destroy.CMD "%~1.%%~A" | ||
SET "%~1.@LIST=" & SET "%~1.@CHILD=" | ||
EXIT /B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::遍历 | ||
:: 参数1: 实例名称 | ||
:: 参数2: 输出格式({0}键占位符, {1}值占位符) | ||
:: 输出: 格式化后的多行字符串 | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
@ECHO OFF | ||
SETLOCAL | ||
SET "@PREFIX=%~1." & SET "@FMT=%~2" | ||
Powershell.EXE -Command "& { Get-Item Env:${Env:@PREFIX}@LIST -ErrorAction Ignore | ForEach-Object Value | ForEach-Object {$PSItem.Split(';',[StringSplitOptions]::RemoveEmptyEntries)} | ForEach-Object {$e=(Get-Item Env:${Env:@PREFIX}$PSItem -ErrorAction Ignore);IF ($e -eq $null) {New-Object System.Collections.DictionaryEntry($PSItem,'')} else {$e.name=$PSItem};$e} | ForEach-Object {${Env:@FMT} -f $PSItem.Name,$PSItem.Value}; Exit -Not $? }" | ||
ENDLOCAL | ||
EXIT /B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
::@author FB | ||
::@version 0.2.0 | ||
|
||
::创建子项 | ||
:: 参数1: 实例名称 | ||
:: 参数2: 子项名称 | ||
|
||
::Script:Map.New.CMD:: | ||
|
||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | ||
|
||
CALL ECHO.%%%~1.@CHILD%% | FIND /I ";%~2;" 1>NUL 2>&1 || ( | ||
CALL SET "%~1.@CHILD=%%%~1.@CHILD%%%~2;" | ||
CALL Map.New.CMD "%~1.%~2" | ||
) | ||
EXIT /B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.