File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,22 @@ curl -sS -o "$ZIP_PATH" "$CHROMEDRIVER_DOWNLOAD_URL"
77
77
unzip -o " $ZIP_PATH " -d " $INSTALL_DIR "
78
78
79
79
# Move the extracted chromedriver binary to the root of INSTALL_DIR
80
- EXTRACTED_DIR=$( find " $INSTALL_DIR " -mindepth 1 -maxdepth 1 -type d | head -n1)
81
- if [ -f " $EXTRACTED_DIR /chromedriver" ]; then
82
- mv " $EXTRACTED_DIR /chromedriver" " $INSTALL_DIR /chromedriver"
80
+ EXTRACTED_DIR=" ${INSTALL_DIR} /chromedriver-${PLATFORM} "
81
+ ALT_DIR=" ${INSTALL_DIR} /chromedriver_${PLATFORM} "
82
+
83
+ if [ -f " ${EXTRACTED_DIR} /chromedriver" ]; then
84
+ mv " ${EXTRACTED_DIR} /chromedriver" " $INSTALL_DIR /chromedriver"
85
+ elif [ -f " ${ALT_DIR} /chromedriver" ]; then
86
+ mv " ${ALT_DIR} /chromedriver" " $INSTALL_DIR /chromedriver"
83
87
else
84
- echo " Error: chromedriver binary not found in $EXTRACTED_DIR "
85
- exit 1
88
+ # Fallback: try to find chromedriver file inside any subdir
89
+ FOUND=$( find " $INSTALL_DIR " -type f -name chromedriver | head -n1)
90
+ if [ -n " $FOUND " ]; then
91
+ mv " $FOUND " " $INSTALL_DIR /chromedriver"
92
+ else
93
+ echo " Error: chromedriver binary not found"
94
+ exit 1
95
+ fi
86
96
fi
87
97
88
98
chmod +x " $INSTALL_DIR /chromedriver"
You can’t perform that action at this time.
0 commit comments