New vhs for 0.1 release
- commit
- 86b12d7ccb4a6f6e032f0a69d5e5f4adcada24f5
- author
- bnema · · 2023-11-09 15:12 UTC
- parent
- d8a0f1d
- signature
- unsigned
7 files · +55 -36
D assets/vhs/demo.gif +0 -0 binary file: no text diff
binary file: no text diff
M assets/vhs/demo.tape +4 -5
| @@ -56,6 +56,7 @@ Output demo.gif | |||
| 56 | 56 | ||
| 57 | 57 | Require echo | |
| 58 | 58 | Require gordon | |
| 59 | + | Require curl | |
| 59 | 60 | ||
| 60 | 61 | Set TypingSpeed 75ms | |
| 61 | 62 | Set Shell "bash" | |
| @@ -80,12 +81,10 @@ Type "-t hello.bamen.dev" | |||
| 80 | 81 | Sleep 1 | |
| 81 | 82 | Enter | |
| 82 | 83 | ||
| 83 | - | Sleep 10 | |
| 84 | - | ||
| 85 | - | Type "curl" | |
| 84 | + | Sleep 15 | |
| 85 | + | Enter | |
| 86 | + | Type "curl https://hello.bamen.dev" | |
| 86 | 87 | Sleep 1 | |
| 87 | - | Space | |
| 88 | - | Type "https://hello.bamen.dev" | |
| 89 | 88 | Enter | |
| 90 | 89 | ||
| 91 | 90 | Sleep 10 | |
| @@ -56,6 +56,7 @@ Output demo.gif | |||||
| 56 | 56 | ||||
| 57 | Require echo | 57 | Require echo | ||
| 58 | Require gordon | 58 | Require gordon | ||
| 59 | + | Require curl | |||
| 59 | 60 | ||||
| 60 | Set TypingSpeed 75ms | 61 | Set TypingSpeed 75ms | ||
| 61 | Set Shell "bash" | 62 | Set Shell "bash" | ||
| @@ -80,12 +81,10 @@ Type "-t hello.bamen.dev" | |||||
| 80 | Sleep 1 | 81 | Sleep 1 | ||
| 81 | Enter | 82 | Enter | ||
| 82 | 83 | ||||
| 83 | - | Sleep 10 | 84 | + | Sleep 15 |
| 84 | - | 85 | + | Enter | |
| 85 | - | Type "curl" | 86 | + | Type "curl https://hello.bamen.dev" |
| 86 | Sleep 1 | 87 | Sleep 1 | ||
| 87 | - | Space | |||
| 88 | - | Type "https://hello.bamen.dev" | |||
| 89 | Enter | 88 | Enter | ||
| 90 | 89 | ||||
| 91 | Sleep 10 | 90 | Sleep 10 | ||
A assets/vhs/demo_deploy.gif +0 -0 binary file: no text diff
binary file: no text diff
M go.mod +0 -1
| @@ -8,7 +8,6 @@ require ( | |||
| 8 | 8 | github.com/charmbracelet/bubbles v0.16.1 | |
| 9 | 9 | github.com/charmbracelet/bubbletea v0.24.1 | |
| 10 | 10 | github.com/charmbracelet/lipgloss v0.7.1 | |
| 11 | - | github.com/cheggaaa/pb v1.0.29 | |
| 12 | 11 | github.com/docker/docker v24.0.6+incompatible | |
| 13 | 12 | github.com/docker/go-connections v0.4.0 | |
| 14 | 13 | github.com/fatih/color v1.15.0 | |
| @@ -8,7 +8,6 @@ require ( | |||||
| 8 | github.com/charmbracelet/bubbles v0.16.1 | 8 | github.com/charmbracelet/bubbles v0.16.1 | ||
| 9 | github.com/charmbracelet/bubbletea v0.24.1 | 9 | github.com/charmbracelet/bubbletea v0.24.1 | ||
| 10 | github.com/charmbracelet/lipgloss v0.7.1 | 10 | github.com/charmbracelet/lipgloss v0.7.1 | ||
| 11 | - | github.com/cheggaaa/pb v1.0.29 | |||
| 12 | github.com/docker/docker v24.0.6+incompatible | 11 | github.com/docker/docker v24.0.6+incompatible | ||
| 13 | github.com/docker/go-connections v0.4.0 | 12 | github.com/docker/go-connections v0.4.0 | ||
| 14 | github.com/fatih/color v1.15.0 | 13 | github.com/fatih/color v1.15.0 | ||
M go.sum +0 -7
| @@ -22,8 +22,6 @@ github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG | |||
| 22 | 22 | github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= | |
| 23 | 23 | github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= | |
| 24 | 24 | github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= | |
| 25 | - | github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= | |
| 26 | - | github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= | |
| 27 | 25 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= | |
| 28 | 26 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= | |
| 29 | 27 | github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | |
| @@ -44,7 +42,6 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 | |||
| 44 | 42 | github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= | |
| 45 | 43 | github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= | |
| 46 | 44 | github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= | |
| 47 | - | github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= | |
| 48 | 45 | github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= | |
| 49 | 46 | github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= | |
| 50 | 47 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= | |
| @@ -88,19 +85,16 @@ github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3 | |||
| 88 | 85 | github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= | |
| 89 | 86 | github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= | |
| 90 | 87 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | |
| 91 | - | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | |
| 92 | 88 | github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= | |
| 93 | 89 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= | |
| 94 | 90 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= | |
| 95 | 91 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | |
| 96 | - | github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= | |
| 97 | 92 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= | |
| 98 | 93 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= | |
| 99 | 94 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= | |
| 100 | 95 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= | |
| 101 | 96 | github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= | |
| 102 | 97 | github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= | |
| 103 | - | github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= | |
| 104 | 98 | github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= | |
| 105 | 99 | github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= | |
| 106 | 100 | github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= | |
| @@ -189,7 +183,6 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= | |||
| 189 | 183 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | |
| 190 | 184 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | |
| 191 | 185 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |
| 192 | - | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |
| 193 | 186 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |
| 194 | 187 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |
| 195 | 188 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |
| @@ -22,8 +22,6 @@ github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG | |||||
| 22 | github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= | 22 | github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= | ||
| 23 | github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= | 23 | github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= | ||
| 24 | github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= | 24 | github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= | ||
| 25 | - | github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= | |||
| 26 | - | github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= | |||
| 27 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= | 25 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= | ||
| 28 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= | 26 | github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= | ||
| 29 | github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | 27 | github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | ||
| @@ -44,7 +42,6 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 | |||||
| 44 | github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= | 42 | github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= | ||
| 45 | github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= | 43 | github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= | ||
| 46 | github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= | 44 | github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= | ||
| 47 | - | github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= | |||
| 48 | github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= | 45 | github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= | ||
| 49 | github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= | 46 | github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= | ||
| 50 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= | 47 | github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= | ||
| @@ -88,19 +85,16 @@ github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3 | |||||
| 88 | github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= | 85 | github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= | ||
| 89 | github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= | 86 | github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= | ||
| 90 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | 87 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | ||
| 91 | - | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | |||
| 92 | github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= | 88 | github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= | ||
| 93 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= | 89 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= | ||
| 94 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= | 90 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= | ||
| 95 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | 91 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||
| 96 | - | github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= | |||
| 97 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= | 92 | github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= | ||
| 98 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= | 93 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= | ||
| 99 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= | 94 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= | ||
| 100 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= | 95 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= | ||
| 101 | github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= | 96 | github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= | ||
| 102 | github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= | 97 | github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= | ||
| 103 | - | github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= | |||
| 104 | github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= | 98 | github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= | ||
| 105 | github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= | 99 | github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= | ||
| 106 | github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= | 100 | github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= | ||
| @@ -189,7 +183,6 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= | |||||
| 189 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | 183 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
| 190 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | 184 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||
| 191 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 185 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
| 192 | - | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |||
| 193 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 186 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
| 194 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 187 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
| 195 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 188 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
M internal/cli/mvu/progressbar.go +1 -23
| @@ -1,9 +1,7 @@ | |||
| 1 | 1 | package mvu | |
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | - | "fmt" | |
| 5 | 4 | "io" | |
| 6 | - | "os" | |
| 7 | 5 | "strings" | |
| 8 | 6 | ||
| 9 | 7 | "github.com/charmbracelet/bubbles/progress" | |
| @@ -33,7 +31,6 @@ type ProgressReader struct { | |||
| 33 | 31 | } | |
| 34 | 32 | ||
| 35 | 33 | func NewPBModel() Model { | |
| 36 | - | // Gradient from #011E5C to #007BC0 | |
| 37 | 34 | m := progress.New(progress.WithGradient("#007BC0", "#011E5C")) | |
| 38 | 35 | m.Width = maxWidth | |
| 39 | 36 | ||
| @@ -42,25 +39,6 @@ func NewPBModel() Model { | |||
| 42 | 39 | } | |
| 43 | 40 | } | |
| 44 | 41 | ||
| 45 | - | // Modify RunProgressBarTUI to return a pointer to Model. | |
| 46 | - | func RunProgressBarTUI(ProgressCh <-chan ProgressMsg) (*Model, error) { | |
| 47 | - | m := NewPBModel() | |
| 48 | - | p := tea.NewProgram(&m) | |
| 49 | - | // Start a goroutine that updates the progress bar as percentages are received on the channel. | |
| 50 | - | go func() { | |
| 51 | - | for percent := range ProgressCh { | |
| 52 | - | p.Send(ProgressMsg(percent)) | |
| 53 | - | } | |
| 54 | - | }() | |
| 55 | - | ||
| 56 | - | if _, err := p.Run(); err != nil { | |
| 57 | - | fmt.Println("Error running progress bar TUI:", err) | |
| 58 | - | os.Exit(1) | |
| 59 | - | } | |
| 60 | - | ||
| 61 | - | return &m, nil // Return a pointer to the model. | |
| 62 | - | } | |
| 63 | - | ||
| 64 | 42 | func (pr *ProgressReader) Read(p []byte) (int, error) { | |
| 65 | 43 | n, err := pr.Reader.Read(p) | |
| 66 | 44 | if err != nil { | |
| @@ -77,7 +55,7 @@ func (pr *ProgressReader) Close() error { | |||
| 77 | 55 | if closer, ok := pr.Reader.(io.Closer); ok { | |
| 78 | 56 | return closer.Close() | |
| 79 | 57 | } | |
| 80 | - | return nil // If there's nothing to close, return nil. | |
| 58 | + | return nil | |
| 81 | 59 | } | |
| 82 | 60 | ||
| 83 | 61 | func (m Model) Init() tea.Cmd { | |
| @@ -1,9 +1,7 @@ | |||||
| 1 | package mvu | 1 | package mvu | ||
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | - | "fmt" | |||
| 5 | "io" | 4 | "io" | ||
| 6 | - | "os" | |||
| 7 | "strings" | 5 | "strings" | ||
| 8 | 6 | ||||
| 9 | "github.com/charmbracelet/bubbles/progress" | 7 | "github.com/charmbracelet/bubbles/progress" | ||
| @@ -33,7 +31,6 @@ type ProgressReader struct { | |||||
| 33 | } | 31 | } | ||
| 34 | 32 | ||||
| 35 | func NewPBModel() Model { | 33 | func NewPBModel() Model { | ||
| 36 | - | // Gradient from #011E5C to #007BC0 | |||
| 37 | m := progress.New(progress.WithGradient("#007BC0", "#011E5C")) | 34 | m := progress.New(progress.WithGradient("#007BC0", "#011E5C")) | ||
| 38 | m.Width = maxWidth | 35 | m.Width = maxWidth | ||
| 39 | 36 | ||||
| @@ -42,25 +39,6 @@ func NewPBModel() Model { | |||||
| 42 | } | 39 | } | ||
| 43 | } | 40 | } | ||
| 44 | 41 | ||||
| 45 | - | // Modify RunProgressBarTUI to return a pointer to Model. | |||
| 46 | - | func RunProgressBarTUI(ProgressCh <-chan ProgressMsg) (*Model, error) { | |||
| 47 | - | m := NewPBModel() | |||
| 48 | - | p := tea.NewProgram(&m) | |||
| 49 | - | // Start a goroutine that updates the progress bar as percentages are received on the channel. | |||
| 50 | - | go func() { | |||
| 51 | - | for percent := range ProgressCh { | |||
| 52 | - | p.Send(ProgressMsg(percent)) | |||
| 53 | - | } | |||
| 54 | - | }() | |||
| 55 | - | ||||
| 56 | - | if _, err := p.Run(); err != nil { | |||
| 57 | - | fmt.Println("Error running progress bar TUI:", err) | |||
| 58 | - | os.Exit(1) | |||
| 59 | - | } | |||
| 60 | - | ||||
| 61 | - | return &m, nil // Return a pointer to the model. | |||
| 62 | - | } | |||
| 63 | - | ||||
| 64 | func (pr *ProgressReader) Read(p []byte) (int, error) { | 42 | func (pr *ProgressReader) Read(p []byte) (int, error) { | ||
| 65 | n, err := pr.Reader.Read(p) | 43 | n, err := pr.Reader.Read(p) | ||
| 66 | if err != nil { | 44 | if err != nil { | ||
| @@ -77,7 +55,7 @@ func (pr *ProgressReader) Close() error { | |||||
| 77 | if closer, ok := pr.Reader.(io.Closer); ok { | 55 | if closer, ok := pr.Reader.(io.Closer); ok { | ||
| 78 | return closer.Close() | 56 | return closer.Close() | ||
| 79 | } | 57 | } | ||
| 80 | - | return nil // If there's nothing to close, return nil. | 58 | + | return nil |
| 81 | } | 59 | } | ||
| 82 | 60 | ||||
| 83 | func (m Model) Init() tea.Cmd { | 61 | func (m Model) Init() tea.Cmd { | ||
A internal/cli/mvu/run.go +50 -0
| @@ -0,0 +1,50 @@ | |||
| 1 | + | package mvu | |
| 2 | + | ||
| 3 | + | import ( | |
| 4 | + | "fmt" | |
| 5 | + | "net/http" | |
| 6 | + | "os" | |
| 7 | + | ||
| 8 | + | tea "github.com/charmbracelet/bubbletea" | |
| 9 | + | ) | |
| 10 | + | ||
| 11 | + | // RunDeploymentTUI runs the complete deployment TUI and returns the final model | |
| 12 | + | func RunDeploymentTUI(client *http.Client, imageName, targetDomain, port string) (SpinnerModel, error) { | |
| 13 | + | m := NewSpinnerModel() | |
| 14 | + | m.deployment.imageName = imageName | |
| 15 | + | m.deployment.targetDomain = targetDomain | |
| 16 | + | m.deployment.port = port | |
| 17 | + | m.deployment.client = client | |
| 18 | + | ||
| 19 | + | p := tea.NewProgram(m) | |
| 20 | + | modelInterface, err := p.Run() | |
| 21 | + | if err != nil { | |
| 22 | + | return SpinnerModel{}, fmt.Errorf("error running TUI program: %w", err) | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | finalModel, ok := modelInterface.(SpinnerModel) | |
| 26 | + | if !ok { | |
| 27 | + | return SpinnerModel{}, fmt.Errorf("could not type assert tea model to concrete type") | |
| 28 | + | } | |
| 29 | + | ||
| 30 | + | return finalModel, nil | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | // RunProgressBarTUI runs the progress bar TUI and returns the final model | |
| 34 | + | func RunProgressBarTUI(ProgressCh <-chan ProgressMsg) (*Model, error) { | |
| 35 | + | m := NewPBModel() | |
| 36 | + | p := tea.NewProgram(&m) | |
| 37 | + | // Start a goroutine that updates the progress bar as percentages are received on the channel. | |
| 38 | + | go func() { | |
| 39 | + | for percent := range ProgressCh { | |
| 40 | + | p.Send(ProgressMsg(percent)) | |
| 41 | + | } | |
| 42 | + | }() | |
| 43 | + | ||
| 44 | + | if _, err := p.Run(); err != nil { | |
| 45 | + | fmt.Println("Error running progress bar TUI:", err) | |
| 46 | + | os.Exit(1) | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | return &m, nil | |
| 50 | + | } | |
| @@ -0,0 +1,50 @@ | |||||
| 1 | + | package mvu | |||
| 2 | + | ||||
| 3 | + | import ( | |||
| 4 | + | "fmt" | |||
| 5 | + | "net/http" | |||
| 6 | + | "os" | |||
| 7 | + | ||||
| 8 | + | tea "github.com/charmbracelet/bubbletea" | |||
| 9 | + | ) | |||
| 10 | + | ||||
| 11 | + | // RunDeploymentTUI runs the complete deployment TUI and returns the final model | |||
| 12 | + | func RunDeploymentTUI(client *http.Client, imageName, targetDomain, port string) (SpinnerModel, error) { | |||
| 13 | + | m := NewSpinnerModel() | |||
| 14 | + | m.deployment.imageName = imageName | |||
| 15 | + | m.deployment.targetDomain = targetDomain | |||
| 16 | + | m.deployment.port = port | |||
| 17 | + | m.deployment.client = client | |||
| 18 | + | ||||
| 19 | + | p := tea.NewProgram(m) | |||
| 20 | + | modelInterface, err := p.Run() | |||
| 21 | + | if err != nil { | |||
| 22 | + | return SpinnerModel{}, fmt.Errorf("error running TUI program: %w", err) | |||
| 23 | + | } | |||
| 24 | + | ||||
| 25 | + | finalModel, ok := modelInterface.(SpinnerModel) | |||
| 26 | + | if !ok { | |||
| 27 | + | return SpinnerModel{}, fmt.Errorf("could not type assert tea model to concrete type") | |||
| 28 | + | } | |||
| 29 | + | ||||
| 30 | + | return finalModel, nil | |||
| 31 | + | } | |||
| 32 | + | ||||
| 33 | + | // RunProgressBarTUI runs the progress bar TUI and returns the final model | |||
| 34 | + | func RunProgressBarTUI(ProgressCh <-chan ProgressMsg) (*Model, error) { | |||
| 35 | + | m := NewPBModel() | |||
| 36 | + | p := tea.NewProgram(&m) | |||
| 37 | + | // Start a goroutine that updates the progress bar as percentages are received on the channel. | |||
| 38 | + | go func() { | |||
| 39 | + | for percent := range ProgressCh { | |||
| 40 | + | p.Send(ProgressMsg(percent)) | |||
| 41 | + | } | |||
| 42 | + | }() | |||
| 43 | + | ||||
| 44 | + | if _, err := p.Run(); err != nil { | |||
| 45 | + | fmt.Println("Error running progress bar TUI:", err) | |||
| 46 | + | os.Exit(1) | |||
| 47 | + | } | |||
| 48 | + | ||||
| 49 | + | return &m, nil | |||
| 50 | + | } | |||