I'm trying to write a bash script to clone into a non-empty directory called ".janus". When I do this script:
#!/bin/bash
localFolder="~/.janus"
repository="git@github.com:aklt/plantuml-syntax.git"
git clone "$repository" "$localFolder"
I get the following error:
fatal: destination path '~/.janus' already exists and is not an empty directory.
What am I doing wrong? I can see if the plantuml-syntax directory already existed, but that is not the case.
If I then change the script to:
#!/bin/bash
localFolder="$HOME/.janus"
repository="git@github.com:aklt/plantuml-syntax.git"
git clone "$repository" "$localFolder"
I get the following error:
fatal: destination path '/Users/user/.janus' already exists and is not an empty directory.