Skip to content

Commit

Permalink
Merge 86d2d39 into 42c8a35
Browse files Browse the repository at this point in the history
  • Loading branch information
ycngadeu-coveo committed Jul 24, 2019
2 parents 42c8a35 + 86d2d39 commit 872e061
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ curl https://raw.githubusercontent.com/coveooss/tgf/master/get-latest-tgf.sh | b

On `Windows` with Powershell:

```powershell
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest https://github.com/coveooss/tgf/releases/download/v1.20.2/tgf_1.20.2_windows_64-bits.zip -OutFile tgf.zip
```PowerShell
(Invoke-WebRequest https://raw.githubusercontent.com/coveooss/tgf/master/get-latest-tgf.ps1).Content | Invoke-Expression
```

## Configuration
Expand Down
23 changes: 23 additions & 0 deletions get-latest-tgf.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$ErrorActionPreference = "Stop" #Make all errors terminating

try {
$bVersion = (Invoke-WebRequest -Uri "https://coveo-bootstrap-us-east-1.s3.amazonaws.com/tgf_version.txt").Content
$LATEST_VERSION = [System.Text.Encoding]::ASCII.GetString($bVersion)
Write-Host "- tgf version (latest):" $LATEST_VERSION
} catch {
Write-Host Error fetching latest version
Exit 1
}

$ZipFile = "tgf.zip"
$TempTgfFolder = "tgf_unzipped"
$TempTgfPath = Join-Path -Path $TempTgfFolder -ChildPath "tgf.exe"

Write-Host "Installing tgf v$($LATEST_VERSION) in the current directory ($(Get-Location)) ..."
Invoke-WebRequest "https://github.com/coveo/tgf/releases/download/v$($LATEST_VERSION)/tgf_$($LATEST_VERSION)_windows_64-bits.zip" -OutFile $ZipFile
Expand-Archive -Path $ZipFile -DestinationPath $TempTgfFolder
Copy-Item $TempTgfPath -Destination $TGF_PATH -Force

Remove-Item $ZipFile
Remove-Item $TempTgfFolder -Recurse
Invoke-Expression -Command "tgf --current-version"

0 comments on commit 872e061

Please sign in to comment.