I have cloned my GitHub repo to the server and for running second command i have finding folder issue:
Logic
Repository will clone to the server in new folder matched name as repo name like:
public_html > Resto
Then I need to enter that Resto
folder in order to run my second command but it returns
No such file or directory
Code
$command1 = 'cd '.$destination.''; //get public_html folder $command2 = 'git clone '.$repos->repository.''; //clone repo in public_html (it creates new folder same as repo name) $command3 = 'cd '.$repos->name.''; //get repo name and enter new folder same as repo name $command4 = 'composer install'; //run new command in repo folder
Issue
The issue here is GitHub give the names like resto
and folder made in my public_html
is named like Resto
so there is capital R
involved.
What I need
I need to let my $command3
ignore case sensitivity and enter that folder regardless of capital R
or if there is any space in folder name (for other clones in future)
How do I do that?
Advertisement
Answer
You can specify where to clone:
git clone <repository> [<directory>]