文档

支持

Unity Version Control

server.conf variables

Configure server variables for triggers in Unity Version Control.
阅读时间1 分钟最后更新于 5 个月前

You can define variables in the
server.conf
file. Their value passes on to the trigger script or program as environment variables. To define these variables, you need to add a section called
TriggerVariables
to the
server.conf
file, which you can find in the server installation folder. The following example shows one way you can use this file:
<?xml version="1.0"?><ServerConfigData> <Language>en</Language> <WorkingMode>UPWorkingMode</WorkingMode> <ServerType>ServerTypeAll</ServerType> <TriggerVariables> <TriggerVariable name="TRIGGERS_PATH" value="c:\triggers" /> </TriggerVariables></ServerConfigData>
This sample defines a variable called
TRIGGERS_PATH
with the value
c:\\triggers
. For example, you can use this variable in the script field when you create a trigger:
cm trigger create before-checkin "code checker" "@TRIGGERS_PATH\stylecheck.bat"
注意
Use
@
to refer to the variable in this context.