-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployFeatures.sh
More file actions
48 lines (38 loc) · 1.07 KB
/
deployFeatures.sh
File metadata and controls
48 lines (38 loc) · 1.07 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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Navigate to the repository (assumes the script runs from within the repo)
REPO_DIR=$(git rev-parse --show-toplevel)
cd "$REPO_DIR"
# Ensure branch is correct
BRANCH_NAME=$(git symbolic-ref --short HEAD)
if [ "$BRANCH_NAME" != "master" ]; then
echo "Switching to the master branch..."
git checkout master
fi
# Create directories if they don't exist
mkdir -p css js
# Create and edit index.html
echo '<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/home.css">
</head>
<body>
<script src="js/home.js"></script>
</body>
</html>' > index.html
# Create and edit home.css
echo 'body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}' > css/home.css
# Create and edit home.js
echo 'let stressLevel = 30;
console.log("Stress Level:", stressLevel);' > js/home.js
# Add the files to the repository
git add index.html css/home.css js/home.js
# Commit the changes
git commit -m "Update project files with deploy script"
# Push to GitHub
git push origin master