1 Variables
Niquel Mendoza edited this page 2026-04-30 22:03:51 +00:00

Variables

Within hook commands, you can reference variables using the following syntax:

${{ }}

These variables are only available in the following functions:

  • tsndep install
  • tsndep update

In other words, they can only be used inside hooks.


Available Variables (Update & Install)

  1. repo.root The directory where the git clone command is executed.

  2. os.sep The operating system path separator:

    • \ on Windows
    • / on Linux/macOS

How It Works

When variables are defined within commands, they are automatically replaced with their corresponding values at runtime.

Internal example:

cmd: str = ctx_rep.Translate(item["command"])

Examples

1. Install dependencies

pip install -r "${{repo.root}}${{os.sep}}TSNDep${{os.sep}}requirements.txt"

2. Update dependencies

pip install -r "${{repo.root}}${{os.sep}}TSNDep${{os.sep}}requirements.txt" --upgrade