@@ -21,6 +21,7 @@ echo " --------- "
2121echo " This may take a couple minutes to install, grab some coffee :)"
2222echo " But don't forget to come back, I'll have questions later!"
2323echo " "
24+ INITIALSTATE_AUTH_SVC=${INITIALSTATE_AUTH_SVC:= " auth" }
2425
2526function check_for_easy_install {
2627 if hash easy_install 2> /dev/null; then
@@ -83,19 +84,25 @@ function check_for_isstreamer {
8384 pip install --upgrade ISStreamer
8485 fi
8586
86- isstreamer_version=$( python -c " import pkg_resources ; print(pkg_resources.get_distribution(' ISStreamer') .version)" )
87+ isstreamer_version=$( python -c " import ISStreamer.version ; print(ISStreamer.version.__version__ )" )
8788
88- echo " Found ISStreamer: $isstreamer_version "
89- isstreamer_version_array=(${isstreamer_version// " " / } )
90- isstreamer_version_num=${isstreamer_version_array[0]}
91- isstreamer_version_num_array=(${isstreamer_version_num// ./ } )
92- isstreamer_major_version=${isstreamer_version_num_array[0]}
93- isstreamer_minor=${isstreamer_version_num_array[1]}
94- isstreamer_minor_version_array=(${isstreamer_minor// " rc" / } )
95- isstreamer_minor_version=${isstreamer_minor_version_array[0]}
9689
97- echo " isstreamer major version: $isstreamer_major_version "
98- echo " isstreamer minor version: $isstreamer_minor_version "
90+ if [[ $isstreamer_version == " " ]] ; then
91+ echo " No ISStreamer found..."
92+ exit 1
93+ else
94+ echo " Found ISStreamer: $isstreamer_version "
95+ isstreamer_version_array=(${isstreamer_version// " " / } )
96+ isstreamer_version_num=${isstreamer_version_array[0]}
97+ isstreamer_version_num_array=(${isstreamer_version_num// ./ } )
98+ isstreamer_major_version=${isstreamer_version_num_array[0]}
99+ isstreamer_minor=${isstreamer_version_num_array[1]}
100+ isstreamer_minor_version_array=(${isstreamer_minor// " rc" / } )
101+ isstreamer_minor_version=${isstreamer_minor_version_array[0]}
102+
103+ echo " isstreamer major version: $isstreamer_major_version "
104+ echo " isstreamer minor version: $isstreamer_minor_version "
105+ fi
99106}
100107
101108function download_script {
@@ -135,7 +142,11 @@ function download_script {
135142 example_location=" ./is_example.py"
136143 fi
137144
138- python_example=$( curl -X POST " https://api.init.st/dev-auth/python/example" -H " X-USER: $username " -H " X-PASS: $password " -H " Accept-Content: text/plain" -m 30 -d " " -s)
145+ echo " getting python example script"
146+ if [ " $INITIALSTATE_AUTH_SVC " != " auth" ]; then
147+ echo " using $INITIALSTATE_AUTH_SVC "
148+ fi
149+ python_example=$( curl -X POST " https://api.init.st/$INITIALSTATE_AUTH_SVC /python/example" -H " X-USER: $username " -H " X-PASS: $password " -H " Accept-Content: text/plain" -m 30 -d " " -s)
139150
140151 if [ " $python_example " = " INVALID_CREDENTIALS" ]; then
141152 echo " invalid credentials, let's try that again!"
0 commit comments