Skip to content

Commit b782d61

Browse files
authored
Update Dockerfile (#24)
1 parent 76632cb commit b782d61

6 files changed

Lines changed: 29 additions & 4 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ ENTRYPOINT ["/usr/bin/ir"]
44
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
55
COPY --from=alpine:latest /tmp /tmp
66
COPY $TARGETPLATFORM/ir /usr/bin/
7+
ENV DOCKER=true

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Easily Install GitHub Release binaries with Windows, Linux and macOS Support.
4848
4949
## Install
5050

51+
[![Latest Release](https://img.shields.io/github/v/release/smashedr/install-release?logo=github&label=latest%20release)](https://github.com/smashedr/install-release/releases)
52+
[![Windows Installer](https://img.shields.io/badge/download-windows--installer.exe-blue?logo=data:image/svg%2bxml;base64,PHN2ZyB3aWR0aD0iMjQ5MCIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI1NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTAgMzYuMzU3TDEwNC42MiAyMi4xMWwuMDQ1IDEwMC45MTQtMTA0LjU3LjU5NUwwIDM2LjM1OHptMTA0LjU3IDk4LjI5M2wuMDggMTAxLjAwMkwuMDgxIDIyMS4yNzVsLS4wMDYtODcuMzAyIDEwNC40OTQuNjc3em0xMi42ODItMTE0LjQwNUwyNTUuOTY4IDB2MTIxLjc0bC0xMzguNzE2IDEuMVYyMC4yNDZ6TTI1NiAxMzUuNmwtLjAzMyAxMjEuMTkxLTEzOC43MTYtMTkuNTc4LS4xOTQtMTAxLjg0TDI1NiAxMzUuNnoiIGZpbGw9IiMwMEFERUYiLz48L3N2Zz4=)](https://github.com/smashedr/install-release/releases/latest/download/ir_Windows_Installer.exe)
53+
5154
#### Homebrew
5255

5356
```shell
@@ -60,15 +63,15 @@ brew install cssnr/tap/install-release
6063
curl https://i.jpillora.com/smashedr/install-release! | bash
6164
```
6265

63-
Alternatively, you can manually [download a release](https://github.com/smashedr/install-release/releases).
66+
💾 Alternatively, you can manually [download a release](https://github.com/smashedr/install-release/releases).
6467

6568
#### PowerShell
6669

6770
```powershell
6871
iex (iwr -useb 'https://raw.githubusercontent.com/smashedr/install-release/refs/heads/master/scripts/install.ps1').Content
6972
```
7073

71-
Windows users can download the [Windows Installer](https://github.com/smashedr/install-release/releases/latest/download/ir_Windows_Installer.exe).
74+
🪟 Windows users can download the [Windows Installer](https://github.com/smashedr/install-release/releases/latest/download/ir_Windows_Installer.exe).
7275

7376
#### Source
7477

cmd/path.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ var pathCmd = &cobra.Command{
2626
binPath := viper.GetString("bin")
2727
log.Debug("pathCmd:", "args", args, "binPath", binPath)
2828

29+
if os.Getenv("DOCKER") == "true" {
30+
log.Errorf("PATH does not work DOCKER.")
31+
return
32+
}
2933
if len(args) < 2 {
3034
_ = cmd.Help()
3135
return

cmd/test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ var testCmd = &cobra.Command{
2222
binPath := viper.GetString("bin")
2323
log.Debug("testCmd:", "args", args, "binPath", binPath)
2424

25+
if os.Getenv("DOCKER") == "true" {
26+
log.Errorf("PATH does not work DOCKER.")
27+
return
28+
}
29+
2530
log.Warnf("This is only a test and does nothing...")
2631

2732
//// Enable Console on Windows (rendering a table does this)

internal/pathmgr/pathmgr.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ import (
44
"fmt"
55
"github.com/charmbracelet/log"
66
"github.com/smashedr/install-release/internal/styles"
7+
"os"
78
)
89

910
func CheckBinPath(binPath string) {
11+
if os.Getenv("DOCKER") == "true" {
12+
log.Infof("Skipping CheckBinPath in DOCKER.")
13+
return
14+
}
1015
//fmt.Printf("CheckBinPath: %s\n", binPath)
1116
result, _, _ := IsDirInPath(binPath)
1217
//fmt.Printf("result: %v\n", result)

scripts/install.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# https://raw.githubusercontent.com/smashedr/install-release/refs/heads/master/scripts/install.ps1
33

44
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '')]
5+
56
param(
67
[string]$bin=""
78
)
@@ -22,7 +23,10 @@ $platform = switch ($true) {
2223
$IsWindows { "Windows" }
2324
$IsLinux { "Linux" }
2425
$IsMacOS { "Darwin" }
25-
default { "unknown" }
26+
default {
27+
Write-Host -ForegroundColor Red "Unable to detect platform!"
28+
throw
29+
}
2630
}
2731
Write-Host -ForegroundColor DarkCyan "platform: $platform"
2832
$osArchitecture = [System.Runtime.InteropServices.RuntimeInformation,mscorlib]::OSArchitecture
@@ -31,7 +35,10 @@ $arch = switch ($osArchitecture) {
3135
"X64" { "x86_64" }
3236
"Arm64" { "arm64" }
3337
"X86" { "i386" }
34-
default { "unknown" }
38+
default {
39+
Write-Host -ForegroundColor Red "Unsupported architecture: $osArchitecture"
40+
throw
41+
}
3542
}
3643
Write-Host -ForegroundColor DarkCyan "arch: $arch"
3744

0 commit comments

Comments
 (0)