Browse Source

Ajout d'une option -t/--target pour definir le nom du repository cible (par defaut calcule d'apres la source)

master
cedric@yterium.com 2 years ago
parent
commit
df8a62ecb6
  1. 15
      .gitattributes
  2. 13
      ImportOneRepository.sh

15
.gitattributes

@ -0,0 +1,15 @@
* text=auto !eol
/.gitignore -text
/ExportToSvn.sh -text
/ImportOneRepository.sh -text
/ImportToGitea.conf.sample -text
/ImportToGitea.sh -text
/cleanSpamAccount.sh -text
/dist.sh -text
models/core-ecrire.conf -text
models/core-prive.conf -text
models/core.conf -text
models/dist.conf -text
models/outils.conf -text
models/zone.conf -text
/readme.md -text

13
ImportOneRepository.sh

@ -19,6 +19,11 @@ case $key in
shift # past argument
shift # past value
;;
-t|--target)
TARGET="$2"
shift # past argument
shift # past value
;;
-m|--model)
MODEL="$2"
shift # past argument
@ -79,11 +84,15 @@ if [ -z "${REPOSITORY}" ]; then
exit 0
fi
if [ -z "${TARGET}" ]; then
TARGET=$(basename "$REPOSITORY")
fi
echo "$REPOSITORY will be import from svn following $MODEL to $ORGANIZATION"
#Disting svn and git repository
repository_svn="$REPOSITORY"
repository_git=$(basename "$REPOSITORY")
repository_git="$TARGET"
#Import svn to git
repo_source=$TMP_SUBGIT_DIR/$repository_svn
@ -131,4 +140,4 @@ sudo subgit register --key /var/git/subgit/subgit.key "$repo_target"
#Clean Directory
rm -rf "$repo_source"
chown "$GIT_UID:$GIT_GID" -R "$repo_target"
sudo chown "$GIT_UID:$GIT_GID" -R "$repo_target"
Loading…
Cancel
Save