Documentation

Support

Unity Version Control

Client side variables

Understand client variables used in Unity Version Control triggers.
Read time 1 minuteLast updated 12 days ago

You can use relative or user-defined paths to customize client-side triggers. You can build the script execution paths in the following ways:
  • Use customized trigger variables defined in the
    client.conf
    file.
  • Use predefined variables.
These approaches allow you to define client-side triggers across platforms.

client.conf
variables

You can define custom variables in the
client.conf
file in your home directory. To use the custom variable when you create a client-side trigger, you need to add a new section with the
TriggerVariables
in the
client.conf
file. The example below defines a variable called
TRIGGERS_PATH
with the
c:\triggers
value:
<?xml version="1.0"?>
<ClientConfigData>
  <Language>en</Language>
  <WorkingMode>UPWorkingMode</WorkingMode>
  
  <TriggerVariables>
    <TriggerVariable name="TRIGGERS_PATH" value="c:\triggers" />
  </TriggerVariables>

</ClientConfigData>
You can use this variable to assign a path when you create a client-side trigger. You can give the path a name that you can use later with your triggers. Refer to the following example:
cm trigger create before-clientcheckin "client code checker" "@TRIGGERS_PATH\addformat.bat"

UVCS predefined variables

There are several predefined values that you can use to compose the script field value when you create a client-side trigger:

Variable

Description

PLASTIC_BIN_PATH
This variable matches the UVCS client installation directory.
WKSPACE_PATH
This variable is the current workspace path when you create the client trigger.
GLOBAL_CONFIG_PATH
This variable points to the global configuration directory of the server you use.

Example trigger

Create a trigger that executes a script in the global configuration directory of the server you're using:
cm trigger create after-update "Delete files after update" "@GLOBAL_CONFIG_PATH/allrepos/triggers/deletefiles.bat"