-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall
More file actions
executable file
·28 lines (28 loc) · 823 Bytes
/
all
File metadata and controls
executable file
·28 lines (28 loc) · 823 Bytes
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
#!/bin/bash
source .functions.sh
for PROJECT in $(grep 'PROJECT' $(find envs -maxdepth 1 -type f -not -path 'envs/.*')|cut -d= -f2)
do
if [[ ${PROJECT} = ${CURRENT_PROJECT} ]]; then
echo "Project: * ${PROJECT} (current)"
else
echo "Project: ${PROJECT}"
fi
SUBCMD=ps
if [ $1 ];then
SUBCMD=$1
fi
echo $PROJECT
#Check Only one project
PROJECT_NUM=$(grep -E "PROJECT=${PROJECT}$" envs/*|wc -l)
if [ $PROJECT_NUM -gt 1 ]; then
grep PROJECT=${PROJECT} envs/*
echo "The smae Project name are found."
exit 1
fi
PROJECT_FILE=$(grep -E "PROJECT=${PROJECT}$" envs/*|cut -d: -f1)
ln -sf ${PROJECT_FILE} .env
echo "Project FILE: ${PROJECT_FILE}"
./console ${SUBCMD}
echo -e "\n"
done
ln -sf ${CURRENT_PROJECT_FILE} .env