Skip to content

Commit 93a20a6

Browse files
authored
Merge pull request #12 from BrowserStackCE/testing_bug_fixes
testing_bug_fixes
2 parents 893c47a + c1e9489 commit 93a20a6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

mac/common-utils.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ handle_app_upload() {
101101
app_platform="android"
102102
export APP_PLATFORM="$app_platform"
103103
log_msg_to "Exported APP_PLATFORM=$APP_PLATFORM"
104-
elif [[ "$choice" == *"Upload my App"* ]]; then
104+
elif [[ "$choice" == *"Upload my App"* ]]; then
105105
upload_custom_app
106106
else
107107
return 1
@@ -119,6 +119,7 @@ upload_sample_app() {
119119
app_url=$(echo "$upload_response" | grep -o '"app_url":"[^"]*' | cut -d'"' -f4)
120120
export BROWSERSTACK_APP=$app_url
121121
log_msg_to "Exported BROWSERSTACK_APP=$BROWSERSTACK_APP"
122+
log_info "Uploaded app URL: $app_url"
122123

123124
if [ -z "$app_url" ]; then
124125
log_msg_to "❌ Upload failed. Response: $upload_response"
@@ -132,13 +133,21 @@ upload_sample_app() {
132133
upload_custom_app() {
133134
local app_platform=""
134135
local file_path
135-
file_path=$(osascript -e 'choose file with prompt "Select your .apk or .ipa file:" of type {"apk", "ipa"}' 2>/dev/null)
136+
137+
# Convert to POSIX path
138+
file_path=$(osascript -e \
139+
'POSIX path of (choose file with prompt "Select your .apk or .ipa file:" of type {"apk", "ipa"})' \
140+
2>/dev/null)
141+
142+
# Trim whitespace
143+
file_path="${file_path%"${file_path##*[![:space:]]}"}"
136144

137145
if [ -z "$file_path" ]; then
138146
log_msg_to "❌ No file selected"
139147
return 1
140148
fi
141149

150+
log_info "Selected file: $file_path"
142151
# Determine platform from file extension
143152
if [[ "$file_path" == *.ipa ]]; then
144153
app_platform="ios"
@@ -164,6 +173,7 @@ upload_custom_app() {
164173

165174
export BROWSERSTACK_APP=$app_url
166175
log_msg_to "✅ App uploaded successfully"
176+
log_info "Uploaded app URL: $app_url"
167177
log_msg_to "Exported BROWSERSTACK_APP=$BROWSERSTACK_APP"
168178

169179
export APP_PLATFORM="$app_platform"

mac/user-interaction.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ get_browserstack_credentials() {
3737
get_tech_stack() {
3838
local run_mode=$1
3939
local tech_stack=""
40-
if [[ "$RUN_MODE" == *"--silent"* || "$RUN_MODE" == *"--debug"* ]]; then
40+
if [[ "$run_mode" == *"--silent"* || "$run_mode" == *"--debug"* ]]; then
4141
tech_stack="$TSTACK"
4242
log_msg_to "✅ Selected Tech Stack from environment: $tech_stack"
4343
else

0 commit comments

Comments
 (0)