File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ function stripIndent ( rawString ) {
2+ const match = rawString . match ( / ^ [ \t ] * (? = \S ) / gm) ;
3+
4+ if ( ! match ) {
5+ return rawString ;
6+ }
7+
8+ const minIndent = Math . min . apply ( Math , match . map ( x => x . length ) ) ;
9+
10+ const reMinIndent = new RegExp ( `^[ \\t]{${ minIndent } }` , 'gm' ) ;
11+
12+ let strReindented = rawString ;
13+ if ( minIndent > 0 ) {
14+ strReindented = rawString . replace ( reMinIndent , '' ) ;
15+ }
16+
17+ return strReindented . trim ( ) ;
18+ } //stripIndent()
19+
20+ function snippet ( raw ) {
21+ // https://regex101.com/r/hKMzZP/4
22+ let normalized = raw . replace ( / ( \s + ^ \s + $ | \s + (? = > ) ) / gm, '' ) ;
23+ return stripIndent ( normalized ) ;
24+ }
25+
26+ export default {
27+ snippet,
28+ } ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ platform_chrome='linux64'
2222[ ` uname` == ' Darwin' ] && platform_gecko=' macos' && platform_chrome=' mac64'
2323
2424TARFILE_GECKO=v0.18.0/geckodriver-v0.18.0-${platform_gecko} .tar.gz
25- TARFILE_CHROME=2.34 /chromedriver_${platform_chrome} .zip
25+ TARFILE_CHROME=2.35 /chromedriver_${platform_chrome} .zip
2626TARFILE_STANDALONE=' 3.4/selenium-server-standalone-3.4.0.jar'
2727
2828if [ $reinstall == " 1" ] || [ $has_gecko == " 0" ]; then
3333
3434if [ $reinstall == " 1" ] || [ $has_chrome == " 0" ]; then
3535 echo Downloading ${TARFILE_CHROME}
36- wget -nc -q https://chromedriver.storage.googleapis.com/${TARFILE_CHROME} -O bin/selenium/chromedriver_2.34 .zip
37- unzip -o bin/selenium/chromedriver_2.34 .zip -d bin/selenium/
36+ wget -nc -q https://chromedriver.storage.googleapis.com/${TARFILE_CHROME} -O bin/selenium/chromedriver_2.35 .zip
37+ unzip -o bin/selenium/chromedriver_2.35 .zip -d bin/selenium/
3838fi
3939
4040if [ $reinstall == " 1" ] || [ $has_chrome == " 0" ]; then
You can’t perform that action at this time.
0 commit comments