Skip to content

Commit

Permalink
install shfmt and shellcheck for building bootstrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAbides committed Aug 8, 2023
1 parent 9e3995d commit 6e54ef8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
6 changes: 6 additions & 0 deletions internal/build-bootstrapper/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ import (
var assets embed.FS

func build(tag, repoRoot string) (_ string, errOut error) {
bindownCmd := exec.Command("script/bindown", "install", "shfmt", "shellcheck")
bindownCmd.Dir = repoRoot
err := bindownCmd.Run()
if err != nil {
return "", err
}
checksumsURL := fmt.Sprintf(
`https://github.com/WillAbides/bindown/releases/download/%s/checksums.txt`,
tag,
Expand Down
16 changes: 0 additions & 16 deletions internal/build-bootstrapper/build_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package main

import (
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"runtime"
Expand All @@ -12,19 +9,6 @@ import (
"github.com/stretchr/testify/require"
)

func TestFoo(t *testing.T) {
resp, err := http.Get("https://github.com/WillAbides/bindown/releases/download/v4.0.0/checksums.txt")
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, resp.Body.Close())
})
require.Equal(t, http.StatusOK, resp.StatusCode)
got, err := io.ReadAll(resp.Body)
require.NoError(t, err)
fmt.Println(string(got))

}

func TestBuild(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
Expand Down

0 comments on commit 6e54ef8

Please sign in to comment.