Skip to content

Commit 5ea4e5b

Browse files
committed
Fixing installation path brew #39
1 parent 0174026 commit 5ea4e5b

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

stackbox-brew.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ echo "\__ \ || (_| | (__| <| |_) | (_) > <"
77
echo '|___/\__\__,_|\___|_|\_\_.__/ \___/_/\_\'
88
echo "\n"
99

10-
echo "######## SELECT YOUR STACK #############\n"
10+
echo "######## SELECT YOUR STACK #############"
1111

1212
stack=()
13+
installationPath=$(brew --cellar stackbox)/$(brew info --json stackbox | jq -r '.[0].installed[0].version')
1314

1415
PS3='Select your frontend: '
1516

@@ -102,7 +103,7 @@ printf "The services you've chosen are: "
102103
echo "${stack[*]}"
103104
printf "\n"
104105

105-
echo "######## BUILDING YOUR STACK ###############\n"
106+
echo "######## BUILDING YOUR STACK ###############"
106107

107108
beginswith() { case $2 in "$1"*) true;; *) false;; esac; }
108109

@@ -111,26 +112,26 @@ python3_version=$(python3 --version)
111112

112113
if beginswith "Python 3" "$python_version" ;
113114
then
114-
var="$(pip --disable-pip-version-check install -r ../requirements.txt) > /dev/null "
115+
var="$(pip --disable-pip-version-check install -r $installationPath/requirements.txt) > /dev/null "
115116
python ../stack.py ${stack[*]}
116117
elif beginswith "Python 3" "$python3_version";
117118
then
118-
var="$(pip3 --disable-pip-version-check install -r ../requirements.txt) > /dev/null"
119+
var="$(pip3 --disable-pip-version-check install -r $installationPath/requirements.txt) > /dev/null"
119120
python3 ../stack.py ${stack[*]}
120121
else
121122
echo "Unable to find a python 3 installation"
122123
fi
123124

124-
docker-compose -f ../docker-compose.yml down 2> /dev/null > logs/docker-compose-down-log.txt
125-
docker-compose -f ../docker-compose.yml build > logs/docker-compose-build-log.txt
125+
docker-compose -f $installationPath/docker-compose.yml down 2> /dev/null > logs/docker-compose-down-log.txt
126+
docker-compose -f $installationPath/docker-compose.yml build > logs/docker-compose-build-log.txt
126127

127-
echo "\n######## DEPLOYING YOUR STACK ##############\n"
128+
echo "######## DEPLOYING YOUR STACK ##############"
128129

129-
docker-compose -f ../docker-compose.yml up -d --remove-orphans
130+
docker-compose -f $installationPath/docker-compose.yml up -d --remove-orphans
130131

131132
sleep 5
132133

133-
echo "\n######## YOUR STACK ########################\n"
134+
echo "######## YOUR STACK ########################"
134135

135136
containers=$(docker ps --format '{{.Names}}')
136137
ports="$(docker ps --format '{{.Ports}}')"
@@ -161,4 +162,9 @@ do
161162
fi
162163
done
163164

164-
echo "\n"
165+
166+
echo "######## SETTING YOUR CODE DIRECTORY #############"
167+
168+
mkdir stackbox
169+
cp -r $installationPath/. stackbox/
170+
echo "Your code is in ./stackbox"

0 commit comments

Comments
 (0)