I've defined a bunch of zsh aliases for compiling my projects, which will basically cd
into my projects directory, and compile the relevant project (which I pass as an argument). Now, I want to include which branch I am building to the output of the function, but am having some difficulty in how to express that in zsh.
I tried using the following below to grab the branch, but to no avail.
function buildproject {
echo "Building project ~/$1 $(git -C '/Users/myuser/$1' branch | grep \* | cut -d ' ' -f2)";
Instead, I get
fatal: cannot change to '/Users/myuser/$1': No such file or directory
And looking at my syntax highlighting, it doesn't seem to recognize the parameter. How can I get zsh to use the parameter?