-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev-bootstrap.sh
More file actions
executable file
·41 lines (36 loc) · 1.3 KB
/
dev-bootstrap.sh
File metadata and controls
executable file
·41 lines (36 loc) · 1.3 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
#!/bin/bash
# This script is used to create symlinks for the environment variables in the apps and packages directories. The source of the environment variables is the .env file in the env package directory.
# Define the directories
app_dir="./apps"
packages_dir="./packages"
# Check if the .env file exists in the `env`` package directory
if [[ ! -f "$packages_dir/env/.env" ]]; then
echo "The .env file does not exist in $packages_dir/env/"
cp "$packages_dir/env/env.example" "$packages_dir/env/.env"
echo "The .env file has been created in $packages_dir/env/"
echo "Please edit the file and add the correct values."
echo "Then run the script again."
fi
# Loop through the subdirectories of the app directory
for dir in "$app_dir"/*; do
# Check if it is a directory
if [[ -d "$dir" ]]; then
# Create the symlink
cd "$dir"
echo `pwd`
ln -s "../../$packages_dir/env/.env" ".env.local"
cd -
fi
done
# Loop through the subdirectories of the packages directory
for dir in "$packages_dir"/*; do
# Check if it is a directory
if [[ -d "$dir" ]]; then
# Create the symlink
cd "$dir"
echo `pwd`
ln -s "../../$packages_dir/env/.env" ".env.local"
ln -s "../../$packages_dir/env/.env" ".env"
cd -
fi
done