Commit cc193ea4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #90 from Razer6/optional_repo_path

Add optional repo path, remove reference to gitolite repo
parents ff33e05b 3b77882e
#!/bin/bash
home_dir="/home/git"
# $1 is an optional argument specifying the location of the repositories directory.
# Defaults to /home/git/repositories if not provided
home_dir="/home/git/repositories"
src=${1:-"$home_dir"}
echo "Danger!!! Data Loss"
while true; do
read -p "Do you wish to delete all directories (except gitolite-admin.git) from $home_dir/repositories/ (y/n) ?: " yn
read -p "Do you wish to delete all directories from $home_dir/ (y/n) ?: " yn
case $yn in
[Yy]* ) sh -c "find $home_dir/repositories/. -maxdepth 1 -not -name 'gitolite-admin.git' -not -name '.' | xargs rm -rf"; break;;
[Yy]* ) sh -c "find $home_dir/. -maxdepth 1 -not -name '.' | xargs rm -rf"; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment