Fix test for directory
[git-tools-moved-to-github.git] / id-clone
1 #!/bin/bash
2 # A simple script to clone a ID git project
3 # because I never remember the long URLs
4
5 # TODO - Try sling-incubator github
6 # TODO - Refactor with a loop of URLs, exit on the same
7
8 PROJ=$1
9 URL="ssh://git.indexdata.com:/home/git"
10 GITHUB="git@github.com:indexdata"
11
12 # Try private project first, then public
13
14 (
15     echo "Cloning $URL/private/$PROJ"
16     git clone "$URL/private/$PROJ"
17 ) ||
18 (
19     echo
20     echo "That did not work"
21     echo "======"
22     echo
23     echo "Cloning $URL/pub/$PROJ"
24     git clone "$URL/pub/$PROJ"
25
26 ) ||
27 (
28     echo
29     echo "That did not work"
30     echo "======"
31     echo
32     echo "Trying to clone $GITHUB/$PROJ.git"
33     git clone "git@github.com:indexdata/$PROJ.git"
34 ) ||
35 (
36     echo 
37     echo "======"
38     echo 
39     echo "Could not check out $PROJ"
40 )