Skip to content

Commit

Permalink
Merge branch 'red-gate:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
csnhawkins authored Jan 28, 2025
2 parents 5981286 + eb6b1bc commit 6d365aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Scripts/Flyway_DownloadAndInstallCLI.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop"

# Flyway Version to Use (Check for latest version: https://documentation.red-gate.com/fd/command-line-184127404.html)
# Flyway Version to Use (Check for latest version: https://documentation.red-gate.com/flyway/reference/usage/command-line)
if ($null -ne ${env:FLYWAY_VERSION}) {
# Environment Variables - Use these if set as a variable - Target Database Connection Details
Write-Output "Using Environment Variables for Flyway CLI Version Number"
Expand Down Expand Up @@ -35,13 +35,13 @@ if ($null -ne ${env:FLYWAY_PATH_LOCATION}) {
}

# Fetch the content of the web page
Write-Output "Analysing https://documentation.red-gate.com/fd/command-line-277579359.html for Latest Version Number"
Write-Output "Analysing https://documentation.red-gate.com/flyway/reference/usage/command-line for Latest Version Number"
# Check if $flywayVersion is 'latest' (case-insensitive)
if ($flywayVersion -ieq "latest") {
# Fetch the content of the web page
try {
# Define the URL to fetch and fetch page content
$url = "https://documentation.red-gate.com/fd/command-line-277579359.html"
$url = "https://documentation.red-gate.com/flyway/reference/usage/command-line"
$response = Invoke-WebRequest -Uri $url -UseBasicParsing
$content = $response.Content

Expand Down
2 changes: 1 addition & 1 deletion Scripts/Flyway_DownloadAndInstallCLI_Unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ get_installed_version() {
# Function to get the latest version from the website
get_latest_version_from_website() {
# Fetch the webpage content
content=$(curl -s https://documentation.red-gate.com/fd/command-line-277579359.html)
content=$(curl -s https://documentation.red-gate.com/flyway/reference/usage/command-line)

# Extract version number using regex
latest_version=$(echo "$content" | grep -oP 'flyway-commandline-\K\d+\.\d+\.\d+(?=-windows-x64.zip)' | head -n 1)
Expand Down

0 comments on commit 6d365aa

Please sign in to comment.