|
@ -59,49 +59,26 @@ echoMainTitle "Create project" |
|
|
echo |
|
|
echo |
|
|
echoSubTitle "Please verify data" |
|
|
echoSubTitle "Please verify data" |
|
|
echo |
|
|
echo |
|
|
echo "Project Path: $workspaces_dir/$customer/$project" |
|
|
|
|
|
echo "Project Data Path: $project_manager_dir/data/$customer/$project" |
|
|
|
|
|
|
|
|
echo "Project path: $workspaces_dir/$customer/$project" |
|
|
|
|
|
echo "Project data path: $project_manager_dir/data/$customer/$project" |
|
|
echo |
|
|
echo |
|
|
confirm |
|
|
confirm |
|
|
|
|
|
|
|
|
projects_string=''; |
|
|
|
|
|
for i in "${!projects[@]}" |
|
|
|
|
|
do |
|
|
|
|
|
((nr=i+1)) |
|
|
|
|
|
projects_string+="$(echo -e "\n\t\"${projects[$i]}\" # $nr")" |
|
|
|
|
|
done |
|
|
|
|
|
((nr=nr+1)) |
|
|
|
|
|
projects_string+="$(echo -e "\n\t\"$project\" # $nr")" |
|
|
|
|
|
|
|
|
|
|
|
shortnames_string=''; |
|
|
|
|
|
for i in "${!shortnames[@]}" |
|
|
|
|
|
do |
|
|
|
|
|
((nr=i+1)) |
|
|
|
|
|
shortnames_string+="$(echo -e "\n\t\"${shortnames[$i]}\" # $nr")" |
|
|
|
|
|
done |
|
|
|
|
|
((nr=nr+1)) |
|
|
|
|
|
shortnames_string+="$(echo -e "\n\t\"$shortname\" # $nr")" |
|
|
|
|
|
|
|
|
|
|
|
customers_string=''; |
|
|
|
|
|
for i in "${!customers[@]}" |
|
|
|
|
|
do |
|
|
|
|
|
((nr=i+1)) |
|
|
|
|
|
customers_string+="$(echo -e "\n\t\"${customers[$i]}\" # $nr")" |
|
|
|
|
|
done |
|
|
|
|
|
((nr=nr+1)) |
|
|
|
|
|
customers_string+="$(echo -e "\n\t\"$customer\" # $nr")" |
|
|
|
|
|
|
|
|
|
|
|
cat <<- EOF > "$project_manager_dir/etc/projects" |
|
|
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
projects=($projects_string |
|
|
|
|
|
) |
|
|
|
|
|
shortnames=($shortnames_string |
|
|
|
|
|
) |
|
|
|
|
|
customers=($customers_string |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if [ -d "$project_manager_dir/data/$customer/$project" ] || [ -d "$project_manager_dir/data/$customer/$project" ] |
|
|
|
|
|
then |
|
|
|
|
|
echo |
|
|
|
|
|
echoError "Data path already exists" |
|
|
|
|
|
echo |
|
|
|
|
|
exit |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
if [ -d "$workspaces_dir/$customer/$project" ] || [ -d "$workspaces_dir/$customer/$project" ] |
|
|
|
|
|
then |
|
|
|
|
|
echo |
|
|
|
|
|
echoError "Path already exists" |
|
|
|
|
|
echo |
|
|
|
|
|
exit |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
path="$project_manager_dir/data/$customer/$project" |
|
|
path="$project_manager_dir/data/$customer/$project" |
|
|
|
|
|
|
|
@ -148,6 +125,45 @@ done |
|
|
|
|
|
|
|
|
if [ ! -d "$workspaces_dir/$customer/$project" ]; then mkdir -p "$workspaces_dir/$customer/$project"; fi |
|
|
if [ ! -d "$workspaces_dir/$customer/$project" ]; then mkdir -p "$workspaces_dir/$customer/$project"; fi |
|
|
|
|
|
|
|
|
|
|
|
projects_string=''; |
|
|
|
|
|
for i in "${!projects[@]}" |
|
|
|
|
|
do |
|
|
|
|
|
((nr=i+1)) |
|
|
|
|
|
projects_string+="$(echo -e "\n\t\"${projects[$i]}\" # $nr")" |
|
|
|
|
|
done |
|
|
|
|
|
((nr=nr+1)) |
|
|
|
|
|
projects_string+="$(echo -e "\n\t\"$project\" # $nr")" |
|
|
|
|
|
|
|
|
|
|
|
shortnames_string=''; |
|
|
|
|
|
for i in "${!shortnames[@]}" |
|
|
|
|
|
do |
|
|
|
|
|
((nr=i+1)) |
|
|
|
|
|
shortnames_string+="$(echo -e "\n\t\"${shortnames[$i]}\" # $nr")" |
|
|
|
|
|
done |
|
|
|
|
|
((nr=nr+1)) |
|
|
|
|
|
shortnames_string+="$(echo -e "\n\t\"$shortname\" # $nr")" |
|
|
|
|
|
|
|
|
|
|
|
customers_string=''; |
|
|
|
|
|
for i in "${!customers[@]}" |
|
|
|
|
|
do |
|
|
|
|
|
((nr=i+1)) |
|
|
|
|
|
customers_string+="$(echo -e "\n\t\"${customers[$i]}\" # $nr")" |
|
|
|
|
|
done |
|
|
|
|
|
((nr=nr+1)) |
|
|
|
|
|
customers_string+="$(echo -e "\n\t\"$customer\" # $nr")" |
|
|
|
|
|
|
|
|
|
|
|
cat <<- EOF > "$project_manager_dir/etc/projects" |
|
|
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
projects=($projects_string |
|
|
|
|
|
) |
|
|
|
|
|
shortnames=($shortnames_string |
|
|
|
|
|
) |
|
|
|
|
|
customers=($customers_string |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
echo |
|
|
echo |
|
|
echoSubTitle "Running postscripts ..." |
|
|
echoSubTitle "Running postscripts ..." |
|
|
postScript "$path/bin/postscripts/commands/create-project" |
|
|
postScript "$path/bin/postscripts/commands/create-project" |
|
|