Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort listed command names #115

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,8 @@ workflows:
jobs:
- clean-gopath
- clean-gomod
- clean-makebb

jobs:
clean-makebb:
<<: [*go122-template, *gomod-template]
steps:
- checkout
- run:
name: check generated code
command: |
mkdir -p /home/circleci/go/bin
go build ./src/cmd/embedvar
cp ./embedvar $GOPATH/bin
export PATH=$GOPATH/bin:$PATH
cd src/pkg/bb
go generate
git status
if [[ -n "$(git status --porcelain .)" ]]; then
echo 'Generated bbmain code is out of date. Run `go install ./src/cmd/embevar && cd src/pkg/bb && go generate` and then check changes in git.'
git status --porcelain .
git diff
exit 1
fi

clean-gopath:
<<: [*go122-template, *gopath-template]
steps:
Expand Down
1 change: 0 additions & 1 deletion src/cmd/embedvar/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions src/cmd/embedvar/embedvar.go

This file was deleted.

8 changes: 8 additions & 0 deletions src/pkg/bb/bb.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ import (
"github.com/u-root/gobusybox/src/pkg/bb/findpkg"
"github.com/u-root/gobusybox/src/pkg/golang"
"github.com/u-root/uio/ulog"

_ "embed"
)

//go:embed bbmain/cmd/main.go
var bbMainSource []byte

//go:embed bbmain/register.go
var bbRegisterSource []byte

func checkDuplicate(cmds []*bbinternal.Package) error {
seen := make(map[string]string)
for _, cmd := range cmds {
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/bb/bbmain/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"errors"
"fmt"
"os"
"sort"
// There MUST NOT be any other dependencies here.
//
// It is preferred to copy minimal code necessary into this file, as
Expand All @@ -28,6 +29,7 @@
for c := range bbCmds {
cmds = append(cmds, c)
}
sort.Strings(cmds)

Check warning on line 32 in src/pkg/bb/bbmain/register.go

View check run for this annotation

Codecov / codecov/patch

src/pkg/bb/bbmain/register.go#L32

Added line #L32 was not covered by tests
return cmds
}

Expand Down
3 changes: 0 additions & 3 deletions src/pkg/bb/bbmain_src.go

This file was deleted.

3 changes: 0 additions & 3 deletions src/pkg/bb/bbregister_src.go

This file was deleted.

4 changes: 0 additions & 4 deletions src/pkg/bb/generate.go

This file was deleted.

Loading