Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 96abdbc7 authored by Christophe Chaudier's avatar Christophe Chaudier :rocket:
Browse files

feat: init config file

parent 791bc758
No related branches found
No related tags found
1 merge request!2Resolve "init : create the configuration file"
Pipeline #1291 passed with warnings
.mygb_config
......@@ -17,19 +17,19 @@
# Constant
readonly USAGE='
mygb.sh <command> [options] \n
\n
Command : \n
init : create the configuration file \n
export : export from GitLab \n
import : import to GitLab \n
\n
Options : \n
-h : print help \n
-c path/to/conf : read one config file \n
-p path/to/projet : export the projet \n
-g path/to/group : export the group and is subgroups and projects \n
-a : export all my group and subgroup \n
mygb.sh <command> [options]
Command :
init : create the configuration file
export : export from GitLab
import : import to GitLab
Options :
-h : print help
-c path/to/conf : read one config file
-p path/to/projet : export the projet
-g path/to/group : export the group and is subgroups and projects
-a : export all my group and subgroup
'
# Vars
......@@ -42,6 +42,7 @@ _help() {
}
_load_config() {
echo "Loading ${config_file} ..."
if [[ -e ${config_file} ]]; then
# shellcheck disable=SC1090
source ${config_file}
......@@ -67,9 +68,24 @@ _create_config() {
echo "${config_file}"
}
_export() {
exit 0
}
_import() {
exit 0
}
main() {
echo "My GitLab Backup"
action=${1}
shift
while getopts c:p:g:ah flag; do
echo "Flag is ${flag}"
# shellcheck disable=SC2034
case "${flag}" in
c) config_file=${OPTARG} ;;
p) project=${OPTARG} ;;
......@@ -79,6 +95,13 @@ main() {
esac
done
case "${action}" in
init) _load_config ;;
export) _export ;;
import) _import ;;
*) _help ;;
esac
_load_config
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment