Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: WillAbides/bindown
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.5
Choose a base ref
...
head repository: WillAbides/bindown
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 12,442 additions and 1,552 deletions.
  1. +114 −15 .github/workflows/ci.yml
  2. +0 −22 .github/workflows/release.yml
  3. +1 −1 .gitignore
  4. +61 −12 .golangci.yml
  5. +9 −7 .goreleaser.yml → .goreleaser.yaml
  6. +0 −34 Makefile
  7. +348 −0 README.md
  8. +0 −86 bindown.go
  9. +0 −82 bindown.json
  10. +195 −0 bindown.schema.json
  11. +178 −0 bindown.schema.yml
  12. +352 −0 bindown.yml
  13. +0 −95 bindown_test.go
  14. +0 −70 bootstrapper/main.sh
  15. +47 −0 cmd/bindown/bootstrap.go
  16. +25 −0 cmd/bindown/bootstrap_test.go
  17. +15 −0 cmd/bindown/cache.go
  18. +55 −0 cmd/bindown/cache_test.go
  19. +60 −0 cmd/bindown/checksums.go
  20. +102 −0 cmd/bindown/checksums_test.go
  21. +419 −0 cmd/bindown/cli.go
  22. +541 −0 cmd/bindown/cli_test.go
  23. +176 −0 cmd/bindown/completion.go
  24. +131 −0 cmd/bindown/completion_test.go
  25. +0 −140 cmd/bindown/config.go
  26. +404 −0 cmd/bindown/dependency.go
  27. +605 −0 cmd/bindown/dependency_test.go
  28. +0 −52 cmd/bindown/download.go
  29. +7 −27 cmd/bindown/main.go
  30. +86 −0 cmd/bindown/supportedsystem.go
  31. +123 −0 cmd/bindown/supportedsystem_test.go
  32. +111 −0 cmd/bindown/template.go
  33. +235 −0 cmd/bindown/template_test.go
  34. +72 −0 cmd/bindown/templatesource.go
  35. +125 −0 cmd/bindown/templatesource_test.go
  36. +22 −0 cmd/bindown/testdata/bootstrap/checksums.txt
  37. +283 −0 cmd/bindown/testdata/golden/bootstrap/bootstrap.sh
  38. +15 −0 cmd/bindown/testdata/golden/wrap/bindown-path/runnable
  39. +271 −0 cmd/bindown/testdata/golden/wrap/wrap-bindown/bindown
  40. +15 −0 cmd/bindown/testdata/golden/wrap/wrap-bindown/runnable
  41. +269 −0 cmd/bindown/testutil_test.go
  42. +12 −6 cmd/bindown/version.go
  43. +11 −0 cmd/bindown/version_test.go
  44. 0 docs/.nojekyll
  45. +143 −0 docs/README.md
  46. +5 −0 docs/_sidebar.md
  47. +3 −0 docs/cli-usage.md
  48. +47 −0 docs/clihelp.txt
  49. +106 −0 docs/configuration.md
  50. +27 −0 docs/index.html
  51. +32 −0 docs/installation.md
  52. +0 −307 downloader.go
  53. +0 −239 downloader_test.go
  54. +57 −9 go.mod
  55. +356 −37 go.sum
  56. +195 −0 internal/bindown/bindown.schema.json
  57. +891 −0 internal/bindown/config.go
  58. +415 −0 internal/bindown/config_test.go
  59. +336 −0 internal/bindown/dependency.go
  60. +209 −0 internal/bindown/dependency_test.go
  61. +138 −0 internal/bindown/download.go
  62. +177 −0 internal/bindown/extract.go
  63. +49 −0 internal/bindown/go_dist_list.txt
  64. +259 −0 internal/bindown/install.go
  65. +30 −0 internal/bindown/jsonschema.go
  66. +83 −0 internal/bindown/jsonschema_test.go
  67. +29 −0 internal/bindown/systems.go
  68. +18 −0 internal/bindown/testdata/configs/dep-add-source.yaml
  69. +55 −0 internal/bindown/testdata/configs/ex1.yaml
  70. +52 −0 internal/bindown/testdata/configs/invalid1.yaml
  71. +1 −0 internal/bindown/testdata/directoryChecksum/bar.txt
  72. +1 −0 internal/bindown/testdata/directoryChecksum/bar/bar.txt
  73. +1 −0 internal/bindown/testdata/directoryChecksum/foo.txt
  74. BIN { → internal/bindown}/testdata/downloadables/foo.tar.gz
  75. BIN { → internal/bindown}/testdata/downloadables/fooinroot.tar.gz
  76. 0 { → internal/bindown}/testdata/downloadables/rawfile/foo
  77. BIN internal/bindown/testdata/downloadables/runnable.tar.gz
  78. +3 −0 internal/bindown/testdata/downloadables/runnable/bin/runnable.sh
  79. BIN internal/bindown/testdata/downloadables/runnable_windows.zip
  80. +2 −0 internal/bindown/testdata/downloadables/runnable_windows/bin/runnable.bat
  81. +21 −0 internal/bindown/testutil_test.go
  82. +327 −0 internal/bindown/util.go
  83. +121 −0 internal/bindown/util_test.go
  84. +13 −0 internal/bindown/wrapper.gotmpl
  85. +15 −0 internal/build-bootstrapper/assets/bootstrap-bindown.gotmpl
  86. +24 −0 internal/build-bootstrapper/assets/bootstrap-main.sh
  87. +52 −0 internal/build-bootstrapper/assets/lib.sh
  88. +6 −48 {bootstrapper → internal/build-bootstrapper/assets}/shlib.sh
  89. +12 −0 internal/build-bootstrapper/assets/wrap-main.sh
  90. +111 −0 internal/build-bootstrapper/build.go
  91. +132 −0 internal/builddep/archivefile.go
  92. +660 −0 internal/builddep/builddep.go
  93. +105 −0 internal/builddep/builddep_test.go
  94. +252 −0 internal/builddep/depgroup.go
  95. +133 −0 internal/builddep/dlfile.go
  96. +361 −0 internal/cache/cache.go
  97. +279 −0 internal/cache/cache_test.go
  98. +28 −0 internal/expecttest/expecttest.go
  99. +49 −0 internal/expecttest/expecttest_posix.go
  100. +19 −0 internal/expecttest/expecttest_windows.go
  101. +27 −0 internal/genjsonschema/genjsonschema.go
  102. +117 −0 internal/testutil/golden.go
  103. +137 −0 internal/testutil/testutil.go
  104. BIN logo.png
  105. +7 −4 script/bindown
  106. +0 −35 script/build-bootstrapper
  107. +26 −0 script/check-module-version
  108. +27 −0 script/deadcode
  109. +7 −3 script/fmt
  110. +40 −0 script/generate
  111. +9 −0 script/generate-jsonschema
  112. +20 −0 script/generate-readme
  113. +7 −0 script/generate-wrappers
  114. +15 −0 script/gofumpt
  115. +15 −0 script/golangci-lint
  116. +6 −5 script/lint
  117. +0 −18 script/release
  118. +15 −0 script/shellcheck
  119. +15 −0 script/shfmt
  120. +2 −2 script/test
  121. +0 −27 script/upload-release-bootstrap
  122. +15 −0 script/yq
  123. +0 −64 testhelper_test.go
  124. +0 −105 util.go
129 changes: 114 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,120 @@
name: ci
on: [push]
on:
push:
branches: [ 'main' ]
pull_request:
types: [ synchronize, opened, reopened, labeled, unlabeled ]
jobs:
cibuild:
matrix_test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
platform:
- ubuntu-22.04
- macos-13
- windows-2022
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Test
run: script/test
- name: Build
run: make bin/bindown
- name: Lint
run: script/lint
- uses: actions/checkout@v3
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.23.5'
- uses: actions/cache@v3
with:
path: |
${{ steps.setup-go.outputs.GOCACHE }}
${{ steps.setup-go.outputs.GOMODCACHE }}
key: ${{ runner.os }}-go-test-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-test
- run: script/test
shell: sh
test:
needs:
- matrix_test
runs-on: ubuntu-22.04
steps:
- run: echo ok
shell: sh
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.23.5'
- uses: actions/cache@v3
with:
path: |
${{ steps.setup-go.outputs.GOCACHE }}
${{ steps.setup-go.outputs.GOMODCACHE }}
.bindown
key: ${{ runner.os }}-go-lint-${{ hashFiles('**/go.sum', 'bindown.yml', 'script/*') }}
restore-keys: ${{ runner.os }}-go-lint
- run: script/lint
- run: script/deadcode
generate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.23.5'
- name: configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- uses: actions/cache@v3
with:
path: |
${{ steps.setup-go.outputs.GOCACHE }}
${{ steps.setup-go.outputs.GOMODCACHE }}
key: ${{ runner.os }}-go-generate-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-generate
- run: script/generate --check
release:
runs-on: ubuntu-22.04
needs:
- test
- lint
- generate
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: WillAbides/setup-go-faster@v1
id: setup-go
with:
go-version: '1.23.5'
- uses: actions/cache@v3
with:
path: |
${{ steps.setup-go.outputs.GOCACHE }}
${{ steps.setup-go.outputs.GOMODCACHE }}
key: ${{ runner.os }}-go-release-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-release
- uses: WillAbides/release-train@v3.3.0
id: release-train
with:
create-release: true
release-refs: main
pre-tag-hook: |
set -e
script/check-module-version "$(go list -m)" "$RELEASE_TAG"
script/bindown install goreleaser
git tag "$RELEASE_TAG"
bin/goreleaser release --clean --skip-publish
cp dist/checksums.txt dist/bindown_*.tar.gz "$ASSETS_DIR"
- if: steps.release-train.outputs.created-release == 'true'
env:
RELEASE_TAG: ${{ steps.release-train.outputs.release-tag }}
GH_TOKEN: ${{ github.token }}
run: |
script/bindown -q install gh
script/bindown bootstrap --tag "$RELEASE_TAG" --output bootstrap-bindown.sh
bin/gh release upload "$RELEASE_TAG" bootstrap-bindown.sh
22 changes: 0 additions & 22 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tmp/
bin/
/bin
dist/
73 changes: 61 additions & 12 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# configure golangci-lint
# see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
issues:
exclude:
- "G304: Potential file inclusion via variable"
- "G107: Potential HTTP request made with variable url"
exclude-use-default: false
exclude-rules:
- path: _test\.go
@@ -10,26 +13,72 @@ issues:
- goconst
linters:
enable:
- golint
- gosec
- interfacer
- unconvert
- gocyclo
- goconst
- goimports
- maligned
- gocritic
- gofumpt
- revive
linters-settings:
gosec:
excludes:
- G204 # Subprocess launched with variable
- G301 # Expect directory permissions to be 0750 or less
- G302 # Expect file permissions to be 0600 or less
- G306 # Expect WriteFile permissions to be 0600 or less
gocritic:
enabled-tags:
- style
- diagnostic
- performance
- opinionated
- experimental
disabled-checks:
- rangeValCopy
- ptrToRefParam
- hugeParam
govet:
enable-all: true
disable:
- fieldalignment
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
govet:
# report about shadowed variables
check-shadowing: true
gocyclo:
# minimal code complexity to report, 30 by default
min-complexity: 15
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
check-type-assertions: true
revive:
rules:
# default rules:
- name: var-declaration
- name: dot-imports
- name: blank-imports
- name: indent-error-flow
- name: range
- name: errorf
- name: error-naming
- name: receiver-naming
- name: increment-decrement
- name: error-return
- name: unexported-return
- name: time-naming
- name: context-keys-type
- name: context-as-argument
- name: empty-block
- name: superfluous-else
- name: unused-parameter
- name: unreachable-code
- name: redefines-builtin-id

# extra rules:
- name: atomic
- name: bare-return
- name: bool-literal-in-expr
- name: comment-spacings
- name: constant-logical-expr
- name: datarace
- name: deep-exit
- name: defer
- name: early-return
- name: import-shadowing
16 changes: 9 additions & 7 deletions .goreleaser.yml → .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: bindown
release:
github:
owner: WillAbides
name: bindown
before:
hooks:
- script/lint
@@ -15,9 +8,18 @@ builds:
- linux
- darwin
- windows
- freebsd
env:
- CGO_ENABLED=0
archives:
- id: tar.gz
builds:
- bindown
format: tar.gz
- id: binary
builds:
- bindown
format: binary
checksum:
name_template: 'checksums.txt'
snapshot:
34 changes: 0 additions & 34 deletions Makefile

This file was deleted.

Loading