08/09/12 16:08:19
小ネタをひとつ。
Mercurial なんかで、細かく分かれたたくさんのリポジトリを一括操作するための苦肉のスクリプト。
bash 用。俺は「hgall」という名前で使ってる
#!/bin/bash
HGREPOS=".hgrepos"
if [ -z $1 ]; then
echo "usage:"
echo " hgall [status|push|pull]"
echo ""
echo " And set repository list to \"\$HOME/$HGREPOS\" file."
exit 0
fi
if [ $1 != "status" ] && [ $1 != "push" ] && [ $1 != "pull" ]; then
echo "Command is \"status\" or \"push\" or \"pull\"."
exit 0
fi
if [ ! -e "$HOME/$HGREPOS" ]; then
echo "$HOME/$HGREPOS not exist."
exit 0
fi
COMMAND=$1
(つづく)