One of my professors told me to write a shell script that checkout code.
His exact words are these :
Write a shell script that will checkout the 'XYZ' code, compile it and run the unit tests.
This XYZ code has a git repo too.
He will be running the code in a docker container. I know that git checkout means to go to another branch but I'm not sure whether I should git clone the repo then git checkout -b new_branch or not
I have only one chance at doing this and I can't do it wrong or ask him.
What does he mean by checkout the code? I have done the other part of compiling and running the unit tests but they only work in root directory of the XYZ cloned repo.
I'm really tensed because I can't do it wrong once more. What should I add in my script file to checkout the code?
This is my script file till now.
source ./init.sh
mkdir "build"
mkdir "install"
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ..
make -j 4 install
echo("Now Testing");
../install/tests/write
../install/tests/read
python ../tests/read.py
make test