Explorar el Código

Add project setup script for Linux environment

Patrick-Christopher Mattulat hace 1 año
padre
commit
26d587103d
Se han modificado 1 ficheros con 44 adiciones y 0 borrados
  1. 44 0
      scripts/setup-dev-environment-linux.sh

+ 44 - 0
scripts/setup-dev-environment-linux.sh

@@ -0,0 +1,44 @@
+#!/bin/bash
+
+project_name="Lynar Studios - Standard Library"
+
+script_directory="$PWD"
+root_directory=$(dirname $script_directory)
+test_directory="$root_directory/test"
+test_resources_directory="$test_directory/resources"
+test_file_name="no-writable.txt"
+test_file_path="$test_resources_directory/$test_file_name"
+
+indentation="  -->"
+error_level="[ERROR]"
+
+########################################
+# script execution
+########################################
+
+echo "Setting up project '$project_name' for development on Linux environment ...
+"
+
+# check if rights are sufficient
+
+echo "$indentation checking rights ..."
+
+if ! sudo -v; then
+  echo "$indentation $error_level no sufficient rights, must be executed as sudo-user ..."
+else
+  echo "$indentation user is sudo ..."
+fi
+
+# list variables
+
+echo "$indentation script directory identified as '$script_directory' ..."
+echo "$indentation root directory identified as '$root_directory' ..."
+echo "$indentation test directory identified as '$test_directory' ..."
+echo "$indentation test resources directory identified as '$test_resources_directory' ..."
+
+# prepare test files
+
+if sudo -v; then
+  echo "$indentation changing permissions for '$test_file_path' file ..."
+  chmod -w "$test_file_path"
+fi