-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetUpDevelopmentEnvironment.sh
More file actions
60 lines (46 loc) · 1.38 KB
/
SetUpDevelopmentEnvironment.sh
File metadata and controls
60 lines (46 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#! /bin/bash
#
# @ File: SetUpDevelopmentEnvironment.sh
#
# @ Brief: Sets up the environment for the simulator repository
#
# @ Description: This script's purpose is to set up the githooks and
# initiate any settings that need to be set for the
# simulator. It effectively should be run once by a user
# which allows their system to be set up without much hassel.
#
# @ Date: 30/12/23
#
set -e
#---------------------------- SETTING UP GITHOOKS ----------------------------#
#
# This will copy all the Git Hooks, found in ".Configuration/GitHooks"
#
echo "[MSG] Setting up githooks"
echo "[...]..."
# Check to make sure files are in git hooks directory
if [ -d .git/hooks ]; then
echo "[MSG] Clearing git hooks"
echo "[...]"
rm -r .git/hooks
fi
# Make directory for githooks
mkdir .git/hooks
# Move hooks
echo "[MSG] Copying hooks:"
echo ""
cp -v .Configuration/GitHooks/* .git/hooks/
echo ""
#--------------------------- SETTING UP PERMISSIONS --------------------------#
#
# This will change the permissions of bash scrits to make them executables
#
echo "[MSG] Changine permissions of bash scripts to +755"
# Change permissions of bash scripts so that they are executable
for i in '**.sh'; do
chmod +755 $i
done
for i in '.git/hooks/**'; do
chmod +755 $i
done
echo "[MSG] Permissions changed successfully"