Skip to content

Commit

Permalink
(feat) Abord if project files exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nitriques committed Jan 27, 2025
1 parent 8889ddc commit c675be4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ echo "Welcome to Deux Huit Huit's Craft cms v5 installer"
echo ""
echo "We are installing projet $PROJECT_CODE in $(pwd)";

## Check if the project is already installed
if [[ -f "craft" ]]; then
echo "Craft executable already exists, aborting."
exit;
elif [[ -d "vendor" ]]; then
echo "Vendor directory already exists, aborting."
exit;
elif [[ -d "config" ]]; then
echo "Config directory already exists, aborting."
exit;
elif [[ -f "composer.json" ]]; then
echo "composer.json file already exists, aborting."
exit;
fi;

read -r -p 'Continue? [Y/n] ';
if [[ "$REPLY" != "Y" ]]; then
echo "Abort."
Expand Down

0 comments on commit c675be4

Please sign in to comment.