Why mkdir cannot be called in tcl script envoked by git?

git, tcl

Solution

Try using `file mkdir dir ?dir ...?`.

Problem

I want to develop custom `git` command using `tcl`. The choice of programming language was done considering ease of learning (as I thought) and availability (`git` ships with `tcl`). I want to create folder using `tcl` script. Normally I'm calling `mkdir <name>` in the script and it works fine, but in case if it `git` command it is saying: `invalid command name "mkdir"`. Am I missing some references to be added to my script to make system commands available for me? The strange thing, that `exec sh` is working. But I don't want to wrap `mkdir` into `sh`... Or is this the only way in my case?

Original source