title: A Bash script to set up Github projects
body: <p>I am using Nitrous.io for some basic dev, the code is managed with git.
  I would like to use a script to set up the git projects on my dev machines (several between Nitrous, work and home).
  [Edit:  Git repo has two rails projects underneath, could have more]</p>
  
  <p>I have the following:</p>
  
  <pre><code>#!/bin/bash
  current=${1-`pwd`}
  echo "Starting directory is $current"
  cd $current
  read -p "Press [Enter] key to start install..."
  
  git init
  git remote add nitrous https://github.com/[user]/[project].git
  git pull nitrous master
  
  for dir in "$( find $current -mindepth 1 -maxdepth 1 -type d -name '[!.]*' )";
    do
      echo "Setting up $dir"
      #cd $dir
      #bundle install
      #rake db:migrate
    done
  
    cd $current
    exit 0
  </code></pre>
  
  <p>But it fails to change directories. (I have commented out the rails actions for the moment)</p>
  
  <pre><code>action@testlog-xxxx:~/workspace$ ../setup.sh                                                                                                                                         
  Starting directory is /home/action/workspace                                                                                                                                          
  Press [Enter] key to start install...                                                                                                                                                 
  Initialized empty Git repository in /home/action/workspace/.git/                                                                                                                      
  remote: Counting objects: 175, done.                                                                                                                                                  
  remote: Compressing objects: 100% (128/128), done.                                                                                                                                    
  remote: Total 175 (delta 31), reused 175 (delta 31)                                                                                                                                   
  Receiving objects: 100% (175/175), 29.44 KiB | 0 bytes/s, done.                                                                                                                       
  Resolving deltas: 100% (31/31), done.                                                                                                                                                 
  From https://github.com/[user]/[project]                                                                                                                                               
   * branch            master     -&gt; FETCH_HEAD                                                                                                                                         
   * [new branch]      master     -&gt; nitrous/master                                                                                                                                     
  Setting up /home/action/workspace/testlog                                                                                                                                             
  /home/action/workspace/testembedded 
  </code></pre>
  
  <p>Anyone with a clue to why?</p>
  
  <p>Regards</p>