Skip to content

Instantly share code, notes, and snippets.

@nobiki
Last active June 17, 2018 15:51
Show Gist options
  • Select an option

  • Save nobiki/b34956be442fb1b0a7074ab3bb7236ad to your computer and use it in GitHub Desktop.

Select an option

Save nobiki/b34956be442fb1b0a7074ab3bb7236ad to your computer and use it in GitHub Desktop.
#
# 説明:
# カレントディレクトリにある空のディレクトリを検出して、
# ディレクトリが空であればREPO_URLからgit cloneするワンライナー
ACCOUNT_NAME=nobiki
# REPO_URL="https://${ACCOUNT_NAME}@example.com/nobiki/"
REPO_URL="git@example.com:${ACCOUNT_NAME}/"
find ./ -type d -maxdepth 1 -empty | sed -e "s/\.\///g" | while read line; do echo -e "\e[1;32m-> $line \n \e[m" && git clone --recursive "$REPO_URL$line.git"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment