Skip to content

Commit

Permalink
Merge pull request #30 from WillAbides/renamerepo
Browse files Browse the repository at this point in the history
change all references to bindownloader to bindown
  • Loading branch information
WillAbides authored Nov 25, 2019
2 parents 117e37b + 7a4dce7 commit f291b39
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project_name: bindown
release:
github:
owner: WillAbides
name: bindownloader
name: bindown
before:
hooks:
- script/lint
Expand Down
2 changes: 1 addition & 1 deletion bindownloader.go → bindown.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bindownloader
package bindown

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion bindownloader_test.go → bindown_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bindownloader
package bindown

import (
"io/ioutil"
Expand Down
6 changes: 3 additions & 3 deletions bootstrapper/main.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
##/ this is the static part of bootstrap-bindownloader.sh
##/ this is the static part of bootstrap-bindown.sh
##/ used in script/build-bootstrapper

FORMAT=tar.gz
GITHUB_DOWNLOAD=https://github.com/WillAbides/bindownloader/releases/download
GITHUB_DOWNLOAD=https://github.com/WillAbides/bindown/releases/download

usage() {
this=$1
cat <<EOT
$this: download go binaries for WillAbides/bindownloader
$this: download go binaries for WillAbides/bindown
Usage: $this [-b] bindir [-d]
-b sets bindir or installation directory, Defaults to ./bin
Expand Down
14 changes: 7 additions & 7 deletions cmd/bindown/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"

"github.com/alecthomas/kong"
"github.com/willabides/bindownloader"
"github.com/willabides/bindown"
)

var configKongVars = kong.Vars{
Expand All @@ -29,7 +29,7 @@ type configCmd struct {
type configFmtCmd struct{}

func (c configFmtCmd) Run() error {
config, err := bindownloader.LoadConfigFile(cli.Configfile)
config, err := bindown.LoadConfigFile(cli.Configfile)
if err != nil {
return err
}
Expand All @@ -45,7 +45,7 @@ type configUpdateChecksumsCmd struct {
}

func (d *configUpdateChecksumsCmd) Run(*kong.Context) error {
config, err := bindownloader.LoadConfigFile(cli.Configfile)
config, err := bindown.LoadConfigFile(cli.Configfile)
if err != nil {
return fmt.Errorf("error loading config from %q", cli.Configfile)
}
Expand All @@ -58,7 +58,7 @@ func (d *configUpdateChecksumsCmd) Run(*kong.Context) error {
}

for _, downloader := range downloaders {
err = downloader.UpdateChecksum(bindownloader.UpdateChecksumOpts{
err = downloader.UpdateChecksum(bindown.UpdateChecksumOpts{
DownloaderName: binary,
CellarDir: cli.CellarDir,
TargetDir: binDir,
Expand All @@ -81,11 +81,11 @@ type configValidateCmd struct {
}

func (d configValidateCmd) Run(kctx *kong.Context) error {
config, err := bindownloader.LoadConfigFile(cli.Configfile)
config, err := bindown.LoadConfigFile(cli.Configfile)
if err != nil {
return fmt.Errorf("error loading config from %q", cli.Configfile)
}
tmpDir, err := ioutil.TempDir("", "bindownloader")
tmpDir, err := ioutil.TempDir("", "bindown")
if err != nil {
return err
}
Expand Down Expand Up @@ -119,7 +119,7 @@ func (d configValidateCmd) Run(kctx *kong.Context) error {
return err
}

installOpts := bindownloader.InstallOpts{
installOpts := bindown.InstallOpts{
DownloaderName: binary,
TargetDir: binDir,
Force: true,
Expand Down
6 changes: 3 additions & 3 deletions cmd/bindown/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"runtime"

"github.com/alecthomas/kong"
"github.com/willabides/bindownloader"
"github.com/willabides/bindown"
)

var downloadKongVars = kong.Vars{
Expand All @@ -26,7 +26,7 @@ type downloadCmd struct {
}

func (d *downloadCmd) Run(*kong.Context) error {
config, err := bindownloader.LoadConfigFile(cli.Configfile)
config, err := bindown.LoadConfigFile(cli.Configfile)
if err != nil {
return fmt.Errorf("error loading config from %q", cli.Configfile)
}
Expand All @@ -41,7 +41,7 @@ os: %s
arch: %s`, binary, d.OS, d.Arch)
}

installOpts := bindownloader.InstallOpts{
installOpts := bindown.InstallOpts{
DownloaderName: binary,
TargetDir: binDir,
Force: d.Force,
Expand Down
10 changes: 5 additions & 5 deletions downloader.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bindownloader
package bindown

import (
"fmt"
Expand Down Expand Up @@ -182,7 +182,7 @@ got: %s`, targetFile, d.Checksum, result)
type UpdateChecksumOpts struct {
// DownloaderName is the downloader's key from the config file
DownloaderName string
// CellarDir is the directory where downloads and extractions will be placed. Default is a <TargetDir>/.bindownloader
// CellarDir is the directory where downloads and extractions will be placed. Default is a <TargetDir>/.bindown
CellarDir string
// TargetDir is the directory where the executable should end up
TargetDir string
Expand All @@ -192,7 +192,7 @@ type UpdateChecksumOpts struct {
func (d *Downloader) UpdateChecksum(opts UpdateChecksumOpts) error {
cellarDir := opts.CellarDir
if cellarDir == "" {
cellarDir = filepath.Join(opts.TargetDir, ".bindownloader")
cellarDir = filepath.Join(opts.TargetDir, ".bindown")
}

downloadDir := filepath.Join(cellarDir, "downloads", d.downloadsSubName())
Expand Down Expand Up @@ -221,7 +221,7 @@ func (d *Downloader) UpdateChecksum(opts UpdateChecksumOpts) error {
type InstallOpts struct {
// DownloaderName is the downloader's key from the config file
DownloaderName string
// CellarDir is the directory where downloads and extractions will be placed. Default is a <TargetDir>/.bindownloader
// CellarDir is the directory where downloads and extractions will be placed. Default is a <TargetDir>/.bindown
CellarDir string
// TargetDir is the directory where the executable should end up
TargetDir string
Expand All @@ -242,7 +242,7 @@ func (d *Downloader) Install(opts InstallOpts) error {
d.setDefaultBinName(opts.DownloaderName)
cellarDir := opts.CellarDir
if cellarDir == "" {
cellarDir = filepath.Join(opts.TargetDir, ".bindownloader")
cellarDir = filepath.Join(opts.TargetDir, ".bindown")
}

downloadDir := filepath.Join(cellarDir, "downloads", d.downloadsSubName())
Expand Down
2 changes: 1 addition & 1 deletion downloader_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bindownloader
package bindown

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/willabides/bindownloader
module github.com/willabides/bindown

go 1.12

Expand Down
2 changes: 1 addition & 1 deletion script/release
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")"
make -s bin/goreleaser bin/semver-next

GITHUB_SHA="${GITHUB_SHA:-"$(git rev-parse HEAD)"}"
GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-"WillAbides/bindownloader"}"
GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-"WillAbides/bindown"}"

bin/semver-next "$GITHUB_REPOSITORY" -r "$GITHUB_SHA" --create-tag

Expand Down
4 changes: 2 additions & 2 deletions script/upload-release-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ AUTH_HEADER="Authorization: token $GITHUB_TOKEN"

TAG="$(grep "^TAG=" dist/bootstrap-bindown.sh | cut -d\" -f2)"

release_id="$(curl -s -H "$AUTH_HEADER" "https://api.github.com/repos/WillAbides/bindownloader/releases/tags/$TAG" | jq .id)"
upload_url="https://uploads.github.com/repos/WillAbides/bindownloader/releases/$release_id/assets?name=bootstrap-bindown.sh"
release_id="$(curl -s -H "$AUTH_HEADER" "https://api.github.com/repos/WillAbides/bindown/releases/tags/$TAG" | jq .id)"
upload_url="https://uploads.github.com/repos/WillAbides/bindown/releases/$release_id/assets?name=bootstrap-bindown.sh"
echo "$upload_url"

file_content="$(cat dist/bootstrap-bindown.sh)"
Expand Down
2 changes: 1 addition & 1 deletion testhelper_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bindownloader
package bindown

import (
"io/ioutil"
Expand Down
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bindownloader
package bindown

import (
"crypto/sha256"
Expand Down

0 comments on commit f291b39

Please sign in to comment.