Show installer download and extract progress
This commit is contained in:
1
package-lock.json
generated
1
package-lock.json
generated
@@ -8,6 +8,7 @@
|
|||||||
"name": "@companion-ai/feynman",
|
"name": "@companion-ai/feynman",
|
||||||
"version": "0.2.12",
|
"version": "0.2.12",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@companion-ai/alpha-hub": "^0.1.2",
|
"@companion-ai/alpha-hub": "^0.1.2",
|
||||||
"@mariozechner/pi-ai": "^0.62.0",
|
"@mariozechner/pi-ai": "^0.62.0",
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ New-Item -ItemType Directory -Path $tmpDir | Out-Null
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$archivePath = Join-Path $tmpDir $archiveName
|
$archivePath = Join-Path $tmpDir $archiveName
|
||||||
|
Write-Host "==> Downloading $archiveName"
|
||||||
Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath
|
Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath
|
||||||
|
|
||||||
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
|
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
|
||||||
@@ -51,11 +52,13 @@ try {
|
|||||||
Remove-Item -Recurse -Force $bundleDir
|
Remove-Item -Recurse -Force $bundleDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "==> Extracting $archiveName"
|
||||||
Expand-Archive -LiteralPath $archivePath -DestinationPath $installRoot -Force
|
Expand-Archive -LiteralPath $archivePath -DestinationPath $installRoot -Force
|
||||||
|
|
||||||
New-Item -ItemType Directory -Path $installBinDir -Force | Out-Null
|
New-Item -ItemType Directory -Path $installBinDir -Force | Out-Null
|
||||||
|
|
||||||
$shimPath = Join-Path $installBinDir "feynman.cmd"
|
$shimPath = Join-Path $installBinDir "feynman.cmd"
|
||||||
|
Write-Host "==> Linking feynman into $installBinDir"
|
||||||
@"
|
@"
|
||||||
@echo off
|
@echo off
|
||||||
"$bundleDir\feynman.cmd" %*
|
"$bundleDir\feynman.cmd" %*
|
||||||
|
|||||||
@@ -32,12 +32,20 @@ download_file() {
|
|||||||
output="$2"
|
output="$2"
|
||||||
|
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
curl -fsSL "$url" -o "$output"
|
if [ -t 2 ]; then
|
||||||
|
curl -fL --progress-bar "$url" -o "$output"
|
||||||
|
else
|
||||||
|
curl -fsSL "$url" -o "$output"
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v wget >/dev/null 2>&1; then
|
if command -v wget >/dev/null 2>&1; then
|
||||||
wget -q -O "$output" "$url"
|
if [ -t 2 ]; then
|
||||||
|
wget --show-progress -O "$output" "$url"
|
||||||
|
else
|
||||||
|
wget -q -O "$output" "$url"
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -174,13 +182,16 @@ cleanup() {
|
|||||||
trap cleanup EXIT INT TERM
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
archive_path="$tmp_dir/$archive_name"
|
archive_path="$tmp_dir/$archive_name"
|
||||||
|
step "Downloading ${archive_name}"
|
||||||
download_file "$download_url" "$archive_path"
|
download_file "$download_url" "$archive_path"
|
||||||
|
|
||||||
mkdir -p "$INSTALL_APP_DIR"
|
mkdir -p "$INSTALL_APP_DIR"
|
||||||
rm -rf "$INSTALL_APP_DIR/$bundle_name"
|
rm -rf "$INSTALL_APP_DIR/$bundle_name"
|
||||||
|
step "Extracting ${archive_name}"
|
||||||
tar -xzf "$archive_path" -C "$INSTALL_APP_DIR"
|
tar -xzf "$archive_path" -C "$INSTALL_APP_DIR"
|
||||||
|
|
||||||
mkdir -p "$INSTALL_BIN_DIR"
|
mkdir -p "$INSTALL_BIN_DIR"
|
||||||
|
step "Linking feynman into $INSTALL_BIN_DIR"
|
||||||
cat >"$INSTALL_BIN_DIR/feynman" <<EOF
|
cat >"$INSTALL_BIN_DIR/feynman" <<EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|||||||
@@ -32,12 +32,20 @@ download_file() {
|
|||||||
output="$2"
|
output="$2"
|
||||||
|
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
curl -fsSL "$url" -o "$output"
|
if [ -t 2 ]; then
|
||||||
|
curl -fL --progress-bar "$url" -o "$output"
|
||||||
|
else
|
||||||
|
curl -fsSL "$url" -o "$output"
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v wget >/dev/null 2>&1; then
|
if command -v wget >/dev/null 2>&1; then
|
||||||
wget -q -O "$output" "$url"
|
if [ -t 2 ]; then
|
||||||
|
wget --show-progress -O "$output" "$url"
|
||||||
|
else
|
||||||
|
wget -q -O "$output" "$url"
|
||||||
|
fi
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -174,13 +182,16 @@ cleanup() {
|
|||||||
trap cleanup EXIT INT TERM
|
trap cleanup EXIT INT TERM
|
||||||
|
|
||||||
archive_path="$tmp_dir/$archive_name"
|
archive_path="$tmp_dir/$archive_name"
|
||||||
|
step "Downloading ${archive_name}"
|
||||||
download_file "$download_url" "$archive_path"
|
download_file "$download_url" "$archive_path"
|
||||||
|
|
||||||
mkdir -p "$INSTALL_APP_DIR"
|
mkdir -p "$INSTALL_APP_DIR"
|
||||||
rm -rf "$INSTALL_APP_DIR/$bundle_name"
|
rm -rf "$INSTALL_APP_DIR/$bundle_name"
|
||||||
|
step "Extracting ${archive_name}"
|
||||||
tar -xzf "$archive_path" -C "$INSTALL_APP_DIR"
|
tar -xzf "$archive_path" -C "$INSTALL_APP_DIR"
|
||||||
|
|
||||||
mkdir -p "$INSTALL_BIN_DIR"
|
mkdir -p "$INSTALL_BIN_DIR"
|
||||||
|
step "Linking feynman into $INSTALL_BIN_DIR"
|
||||||
cat >"$INSTALL_BIN_DIR/feynman" <<EOF
|
cat >"$INSTALL_BIN_DIR/feynman" <<EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ New-Item -ItemType Directory -Path $tmpDir | Out-Null
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$archivePath = Join-Path $tmpDir $archiveName
|
$archivePath = Join-Path $tmpDir $archiveName
|
||||||
|
Write-Host "==> Downloading $archiveName"
|
||||||
Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath
|
Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath
|
||||||
|
|
||||||
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
|
New-Item -ItemType Directory -Path $installRoot -Force | Out-Null
|
||||||
@@ -51,11 +52,13 @@ try {
|
|||||||
Remove-Item -Recurse -Force $bundleDir
|
Remove-Item -Recurse -Force $bundleDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "==> Extracting $archiveName"
|
||||||
Expand-Archive -LiteralPath $archivePath -DestinationPath $installRoot -Force
|
Expand-Archive -LiteralPath $archivePath -DestinationPath $installRoot -Force
|
||||||
|
|
||||||
New-Item -ItemType Directory -Path $installBinDir -Force | Out-Null
|
New-Item -ItemType Directory -Path $installBinDir -Force | Out-Null
|
||||||
|
|
||||||
$shimPath = Join-Path $installBinDir "feynman.cmd"
|
$shimPath = Join-Path $installBinDir "feynman.cmd"
|
||||||
|
Write-Host "==> Linking feynman into $installBinDir"
|
||||||
@"
|
@"
|
||||||
@echo off
|
@echo off
|
||||||
"$bundleDir\feynman.cmd" %*
|
"$bundleDir\feynman.cmd" %*
|
||||||
|
|||||||
Reference in New Issue
Block a user