Skip to content

Instantly share code, notes, and snippets.

@WesleyCh3n
Last active May 16, 2022 04:23
Show Gist options
  • Save WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89 to your computer and use it in GitHub Desktop.
Save WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89 to your computer and use it in GitHub Desktop.
Analyze install script
Write-Host @'
Downloading fuan analyze...
'@
$root_dir = "fuan.analyze"
if (Test-Path $root_dir) {
Remove-Item $root_dir -Force -Recurse
}
$url = "https://github.com/WesleyCh3n/analyze.api/releases/download/latest/analyze.api-x86_64-pc-windows-msvc.zip"
Invoke-WebRequest -OutFile analyze_api.zip $url
Expand-Archive analyze_api.zip -DestinationPath ./$root_dir/
$url = "https://github.com/WesleyCh3n/analyze.rs/releases/download/latest/analyze.rs-x86_64-pc-windows-msvc.zip"
Invoke-WebRequest -OutFile analyze_rs.zip $url
Expand-Archive analyze_rs.zip -DestinationPath ./$root_dir/
New-Item -Path "./$root_dir/bin" -ItemType "directory" | Out-Null
Move-Item -Path "./$root_dir/analyze-rs.exe" -Destination "./$root_dir/bin/analyze-rs.exe"
$url = "https://github.com/WesleyCh3n/analyze.web/releases/download/latest/analyze.web-static.tar.gz"
Invoke-WebRequest -OutFile analyze_web.tar.gz $url
tar -xf analyze_web.tar.gz -C ./$root_dir/assets/
Remove-Item analyze*.zip
Remove-Item analyze*.tar.gz
Write-Host @'
Finished!
'@
Write-Host -ForegroundColor Green @'
Go to `fuan.analyze` folder and open analyze-api.exe.
Then, go to `localhost:3001` in the browsJer.
'@
printf "Downloading fuan analyze...\n"
ROOT_DIR="fuan.analyze"
rm -rf $ROOT_DIR
mkdir -p $ROOT_DIR/bin
url="https://github.com/WesleyCh3n/analyze.api/releases/download/latest/analyze.api-x86_64-unknown-linux-gnu.tar.gz"
curl '-#' -fLO $url
tar xf analyze.api-x86_64-unknown-linux-gnu.tar.gz -C $ROOT_DIR
url="https://github.com/WesleyCh3n/analyze.rs/releases/download/latest/analyze.rs-x86_64-unknown-linux-gnu.tar.gz"
curl '-#' -fLO $url
tar xf analyze.rs-x86_64-unknown-linux-gnu.tar.gz -C $ROOT_DIR
mv $ROOT_DIR/analyze-rs $ROOT_DIR/bin/
url="https://github.com/WesleyCh3n/analyze.web/releases/download/latest/analyze.web-static.tar.gz"
curl '-#' -fLO $url
tar xf analyze.web-static.tar.gz -C $ROOT_DIR/assets/
rm analyze*.tar.gz
printf "Finished!!\n\n"
GREEN='\033[0;32m'
NC='\033[0m' # No Color
printf "${GREEN}Go to fuan.analyze folder and execute analyze-api
Then, go to localhost:3001 in the browser.${NC}\n"
@WesleyCh3n
Copy link
Author

WesleyCh3n commented May 3, 2022

In Windows PowerShell

Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://gist.github.com/WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89/raw/install.ps1'))
# or shorter
iwr -useb https://gist.github.com/WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89/raw/install.ps1 | iex

Directly to Desktop

cd ~/Desktop/; Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://gist.github.com/WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89/raw/install.ps1'))
# or shorter
cd ~/Desktop/; iwr -useb https://gist.github.com/WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89/raw/install.ps1 | iex

@WesleyCh3n
Copy link
Author

WesleyCh3n commented May 4, 2022

In Linux Terminal

curl -sSL https://gist.github.com/WesleyCh3n/54aa9fa5e31bf861bea0ee50ccf9ea89/raw/install.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment