Commits

Mark Roddy  committed bd8a907

note that the repos need to exist on github, add '-l' so you can see them

  • Participants
  • Parent commits 891190e

Comments (0)

Files changed (2)

 
 
 usage:
+1) Create an empty repo on github for each of your public bitbucket repo, to
+see a list of these repos, run:
+> bb2gh -l bitbucket-user-name
+
+2) Run the replication:
 > bb2gh bitbucket-user-name [github-user-name]
 
 Note that for the sake of repo identification, github user names are case sensative.
     ghusername=$2;
 fi
 
+if [ '-l' = "$bbusername" ]; then
+    bbusername=$ghusername
+fi
+
 repourl="https://api.bitbucket.org/1.0/users/$bbusername/"
 
 json=`curl --silent --show-error $repourl`
     print "%s,%s" % (r["slug"],r["scm"])
 '`
 
+# Just list the bitbucket repos
+if [ "-l" = "$1" ]; then
+    for repo in $repos; do
+        reponame=`echo $repo|cut -d ',' -f 1`
+        scm=`echo $repo|cut -d ',' -f 2`
+        echo "$reponame ($scm)"
+    done
+    exit 0;
+fi
+
 codir="/tmp"
 for repo in $repos; do
     reponame=`echo $repo|cut -d ',' -f 1`