Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df9dac7

Browse files
authored
Merge pull request #772 from utPLSQL/bugfix/fix_travis_sqlcl_download_vini
Fix sqlcl download
2 parents 013cba3 + 2a6c82c commit df9dac7

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

.travis/download.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var paramUsername = casper.cli.get(0);
1717
var paramPassword = casper.cli.get(1);
1818
var agreementUrl = casper.cli.get(2);
1919
var downloadUrl = casper.cli.get(3);
20+
var downloaded = false;
2021

2122
casper.start();
2223
// TODO: Error handling.
@@ -41,10 +42,11 @@ casper.thenOpen(downloadUrl).waitForUrl(/signon\.jsp$/, function (re) {
4142
});
4243

4344
casper.on("resource.received", function (resource) {
44-
if (resource.url.indexOf("AuthParam") !== -1) {
45+
if (resource.url.indexOf("AuthParam") !== -1 && !downloaded) {
4546
// this.echo("DownloadUrl:");
4647
// Print the download url.
4748
this.echo(resource.url);
49+
downloaded = true;
4850
// TODO: Try to download file from here. this.download is not working because of cross site request.
4951
}
5052
});

.travis/download.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ PRODUCT=""
1212
# Then download the file using curl.
1313
downloadFile() {
1414
downloadUrl=$(exec casperjs download.js $ORACLE_OTN_USER $ORACLE_OTN_PASSWORD $1 $2)
15+
downloadUrl=${downloadUrl%$'\r'}
1516
echo "DownloadURL: $downloadUrl"
16-
curl $downloadUrl -o $3
17+
curl -o $3 -L "$downloadUrl"
1718
}
1819

1920
#############################
@@ -60,8 +61,8 @@ fi
6061

6162
if [ "$PRODUCT" == "sqlcl" ]; then
6263
agreementUrl="http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html"
63-
downloadUrl="http://download.oracle.com/otn/java/sqldeveloper/sqlcl-18.2.0.zip"
64-
outputFile=sqlcl-18.2.0.zip
64+
downloadUrl="https://download.oracle.com/otn/java/sqldeveloper/sqlcl-18.3.0.259.2029.zip"
65+
outputFile=sqlcl-18.3.0.259.2029.zip
6566
downloadFile $agreementUrl $downloadUrl $outputFile
6667
exit 0
6768
fi

.travis/install_sqlcl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
SQLCL_FILE=sqlcl-18.2.0.zip
4+
SQLCL_FILE=sqlcl-18.3.0.259.2029.zip
55
cd .travis
66

77
# Download if not present on cache dir.

0 commit comments

Comments
 (0)