diff --git a/package-lock.json b/package-lock.json index 61d9653..77b7f77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "@companion-ai/feynman", "version": "0.2.12", "hasInstallScript": true, + "license": "MIT", "dependencies": { "@companion-ai/alpha-hub": "^0.1.2", "@mariozechner/pi-ai": "^0.62.0", diff --git a/scripts/install/install.ps1 b/scripts/install/install.ps1 index 8a04849..1ef2deb 100644 --- a/scripts/install/install.ps1 +++ b/scripts/install/install.ps1 @@ -44,6 +44,7 @@ New-Item -ItemType Directory -Path $tmpDir | Out-Null try { $archivePath = Join-Path $tmpDir $archiveName + Write-Host "==> Downloading $archiveName" Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath New-Item -ItemType Directory -Path $installRoot -Force | Out-Null @@ -51,11 +52,13 @@ try { Remove-Item -Recurse -Force $bundleDir } + Write-Host "==> Extracting $archiveName" Expand-Archive -LiteralPath $archivePath -DestinationPath $installRoot -Force New-Item -ItemType Directory -Path $installBinDir -Force | Out-Null $shimPath = Join-Path $installBinDir "feynman.cmd" + Write-Host "==> Linking feynman into $installBinDir" @" @echo off "$bundleDir\feynman.cmd" %* diff --git a/scripts/install/install.sh b/scripts/install/install.sh index e172834..93b2cc3 100644 --- a/scripts/install/install.sh +++ b/scripts/install/install.sh @@ -32,12 +32,20 @@ download_file() { output="$2" 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 fi 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 fi @@ -174,13 +182,16 @@ cleanup() { trap cleanup EXIT INT TERM archive_path="$tmp_dir/$archive_name" +step "Downloading ${archive_name}" download_file "$download_url" "$archive_path" mkdir -p "$INSTALL_APP_DIR" rm -rf "$INSTALL_APP_DIR/$bundle_name" +step "Extracting ${archive_name}" tar -xzf "$archive_path" -C "$INSTALL_APP_DIR" mkdir -p "$INSTALL_BIN_DIR" +step "Linking feynman into $INSTALL_BIN_DIR" cat >"$INSTALL_BIN_DIR/feynman" </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 fi 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 fi @@ -174,13 +182,16 @@ cleanup() { trap cleanup EXIT INT TERM archive_path="$tmp_dir/$archive_name" +step "Downloading ${archive_name}" download_file "$download_url" "$archive_path" mkdir -p "$INSTALL_APP_DIR" rm -rf "$INSTALL_APP_DIR/$bundle_name" +step "Extracting ${archive_name}" tar -xzf "$archive_path" -C "$INSTALL_APP_DIR" mkdir -p "$INSTALL_BIN_DIR" +step "Linking feynman into $INSTALL_BIN_DIR" cat >"$INSTALL_BIN_DIR/feynman" < Downloading $archiveName" Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath New-Item -ItemType Directory -Path $installRoot -Force | Out-Null @@ -51,11 +52,13 @@ try { Remove-Item -Recurse -Force $bundleDir } + Write-Host "==> Extracting $archiveName" Expand-Archive -LiteralPath $archivePath -DestinationPath $installRoot -Force New-Item -ItemType Directory -Path $installBinDir -Force | Out-Null $shimPath = Join-Path $installBinDir "feynman.cmd" + Write-Host "==> Linking feynman into $installBinDir" @" @echo off "$bundleDir\feynman.cmd" %*