From 6674889e02643da5b9937b3ad7954bc357d44835 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Sat, 5 Jan 2019 19:03:11 +0100
Subject: [PATCH] #15 Rename the start script in the repository but keep the
 name in the container

---
 .start   | 77 --------------------------------------------------------
 start.sh | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+), 77 deletions(-)
 delete mode 100755 .start
 create mode 100755 start.sh

diff --git a/.start b/.start
deleted file mode 100755
index 82e9903..0000000
--- a/.start
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/bash
-
-function truncateCurrentDirectory {
-  if [[ -f ".env" ]]; then
-    export $(cat .env | xargs) > /dev/null 2>&1
-  fi
-  rm .* > /dev/null 2>&1
-}
-
-function restoreEnvFile {
-  if [[ -n ${PHP_VERSION} ]]; then
-    echo "PHP_VERSION=${PHP_VERSION}" >>.env
-  fi
-  if [[ -n ${COMPOSE_PROJECT_NAME} ]]; then
-    echo "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}" >>.env
-  fi
-  if [[ -f ".env" ]]; then
-    env -i $(cat .env | xargs) >.env
-  fi
-}
-
-function create {
-  truncateCurrentDirectory
-  composer create-project ${PROJECT} . --no-interaction
-  restoreEnvFile
-}
-
-EXISTING=$(ls -1)
-if [[ -n "$EXISTING" ]]; then
-  restoreEnvFile
-  exit
-fi
-
-echo "Lets start a new project here ..."
-echo ""
-echo "Options to start:"
-echo "    1   LakeDrops Drupal 8 project template"
-echo "    2   Drupal's community project template"
-echo "    3   Existing git repository"
-echo ""
-echo ""
-
-while true; do
-    read -p "Choose an option: " OPTION
-    case ${OPTION} in
-
-        1 )
-          PROJECT="lakedrops/d8-project"
-          create
-          break
-          ;;
-
-        2 )
-          PROJECT="drupal-composer/drupal-project:8.x-dev"
-          create
-          break
-          ;;
-
-        3 )
-          read -p "Repository URL: " REPOSITORY
-          if [[ -n "${REPOSITORY}" ]]; then
-            truncateCurrentDirectory
-            git clone ${REPOSITORY} .
-            composer update
-            restoreEnvFile
-            break
-          fi
-          ;;
-
-        * )
-          echo "Please try again."
-          ;;
-    esac
-done
-
-restoreEnvFile
-/usr/bin/fish
diff --git a/start.sh b/start.sh
new file mode 100755
index 0000000..770cd79
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+function truncateCurrentDirectory {
+  if [[ -f ".env" ]]; then
+    export $(cat .env | xargs) > /dev/null 2>&1
+  fi
+  rm .* > /dev/null 2>&1
+}
+
+function restoreEnvFile {
+  if [[ -n ${PHP_VERSION} ]]; then
+    echo "PHP_VERSION=${PHP_VERSION}" >>.env
+  fi
+  if [[ -n ${COMPOSE_PROJECT_NAME} ]]; then
+    echo "COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}" >>.env
+  fi
+  if [[ -f ".env" ]]; then
+    env -i $(cat .env | xargs) >.env
+  fi
+}
+
+function create {
+  truncateCurrentDirectory
+  composer create-project ${PROJECT} . --no-interaction
+  restoreEnvFile
+}
+
+EXISTING=$(ls -1)
+if [[ ! -n "$EXISTING" ]]; then
+  echo "Lets start a new project here ..."
+  echo ""
+  echo "Options to start:"
+  echo "    1   LakeDrops Drupal 8 project template"
+  echo "    2   Drupal's community project template"
+  echo "    3   Existing git repository"
+  echo ""
+  echo ""
+
+  while true; do
+      read -p "Choose an option: " OPTION
+      case ${OPTION} in
+
+          1 )
+            PROJECT="lakedrops/d8-project"
+            create
+            break
+            ;;
+
+          2 )
+            PROJECT="drupal-composer/drupal-project:8.x-dev"
+            create
+            break
+            ;;
+
+          3 )
+            read -p "Repository URL: " REPOSITORY
+            if [[ -n "${REPOSITORY}" ]]; then
+              truncateCurrentDirectory
+              git clone ${REPOSITORY} .
+              composer update
+              restoreEnvFile
+              break
+            fi
+            ;;
+
+          * )
+            echo "Please try again."
+            ;;
+      esac
+  done
+fi
+
+restoreEnvFile
+/usr/bin/fish
-- 
GitLab