2 # Clean up a Drupal project directory
4 # Copyright (C) 2017 Antonio Ospite <ao2@ao2.it>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 usage: drin $(basename "$0" .sh) [-h|--help]
25 Cleanup the project, removing all the installed files.
28 -h, --help display this usage message and exit
40 echo "Error: Unknown option '${1}'" 1>&2
46 [ -f "bootstrap.conf" ] || { echo "Aborting, run this command from the Drupal project directory." 1>&2; exit 1; }
48 CONFIRMATION_STRING="YESIAMSURE"
50 echo "WARNING! This removes any files in the config/ web/ and vendor/ directories."
51 echo "Are you sure you want to continue?"
53 read -r -p "Type ${CONFIRMATION_STRING} to confirm: " INPUT
60 [ "$INPUT" = "$CONFIRMATION_STRING" ] && run sudo rm -rf config/ web/ vendor/ composer.lock