Browse Source

fix remove

master
Sven Ullmann 2 years ago
parent
commit
e170e12ec2
  1. 8
      README.md
  2. 15
      bin/commands/remove-project

8
README.md

@ -44,4 +44,10 @@ In order to use the project manager you have to execute it once
## Configure your project ## Configure your project
![](.images/configure-your-project.png)
![](.images/configure-your-project.png)
## Add a new Subdomain
![](.images/adding-subdomain-project.png)

15
bin/commands/remove-project

@ -104,13 +104,24 @@ EOF
echo echo
echo "Moving files to trash" echo "Moving files to trash"
customer_dir_list="$(ls -t "$project_manager_dir/data/$customer")"
has_more_dirs=$(if [ "${#customer_dir_list[*]}" -gt 1 ]; then echo true; else echo false; fi)
rand=$(cat /proc/sys/kernel/random/uuid) rand=$(cat /proc/sys/kernel/random/uuid)
trash_path="$project_manager_dir/.trash/$rand" trash_path="$project_manager_dir/.trash/$rand"
mkdir "$trash_path" mkdir "$trash_path"
mkdir "$trash_path/data" mkdir "$trash_path/data"
mkdir "$trash_path/workspace" mkdir "$trash_path/workspace"
mv "$project_manager_dir/data/$customer" "$trash_path/data/$customer"
mv "$workspaces_dir/$customer" "$trash_path/workspace/$customer"
mkdir "$trash_path/data/$customer"
mkdir "$trash_path/workspace/$customer"
mv "$project_manager_dir/data/$customer/$project" "$trash_path/data/$customer/$project"
mv "$workspaces_dir/$customer/$project" "$trash_path/workspace/$customer/$project"
if [ "$has_more_dirs" == false ]
then
rmdir "$project_manager_dir/data/$customer"
rmdir "$workspaces_dir/$customer"
fi
echo echo
echoSubTitle "Running postscripts ..." echoSubTitle "Running postscripts ..."

Loading…
Cancel
Save