Skip to content

Commit

Permalink
Pathbird rename
Browse files Browse the repository at this point in the history
  • Loading branch information
twavv committed Jun 14, 2021
1 parent ac79d7d commit d9c741e
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 81 deletions.
14 changes: 6 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
project_name: mynerva-author
project_name: pbauthor

# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
Expand All @@ -18,7 +16,7 @@ builds:
- amd64
- arm64
ldflags:
- "-X 'github.com/mynerva-io/author-cli/internal/version.Version={{ .Version }}'"
- "-X 'github.com/pathbird/pbauthor/internal/version.Version={{ .Version }}'"
archives:
- replacements:
darwin: macos
Expand All @@ -35,16 +33,16 @@ changelog:

scoop:
bucket:
owner: mynerva-io
owner: pathbird
name: scoop-bucket

commit_author: &commit_author
email: goreleaserbot@mynerva.io
email: goreleaserbot@pathbird.com

homepage: "https://mynerva.io/"
homepage: "https://pathbird.com/"

brews:
- tap:
owner: mynerva-io
owner: pathbird
name: homebrew-tap
commit_author: *commit_author
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# What is this?

Mynerva is a platform for creating, distributing, and hosting experiential
educational content. See the [Mynerva website](https://mynerva.io/) for more
information about Mynerva.
Pathbird is a platform for creating, distributing, and hosting experiential
educational content. See the [Pathbird website](https://pathbird.io/) for more
information about Pathbird.

The authoring platform is currently available via invitation. If you're
interesting in authoring on Mynerva, please
[request an invitation](https://forms.office.com/Pages/ResponsePage.aspx?id=cFbouBAmSk2vcnxt3VMlwbJg85jcPCpCrF0eBHnGiARURE1NSU5MVE85QTNZQklLRlY4MThQOFRTTC4u)
interesting in authoring on Pathbird, please
[request an invitation](https://docs.google.com/forms/d/e/1FAIpQLSd0nr5T09JkKyK73Q89bTWzC5mxskQcV32nwTlPTw1iUT_3Zw/viewform?usp=sf_link)
(we're friendly, we promise!).

# Installation

See the [Installation documentation](./docs/install.md) for instructions on how
to install the `mynerva-author` command line tool.
to install the `pbauthor` command line tool.

# Usage

The `mynerva-author` command line tool is under active development and may
The `pbauthor` command line tool is under active development and may
change rapidly. For usage instructions, including a quick-start guide and MyST
syntax reference, please see the
[Authoring on Mynerva](https://www.notion.so/Authoring-on-Mynerva-e4bae239b894423cb87e63c5a16673b7)
[Authoring on Pathbird](https://www.notion.so/Authoring-on-Pathbird-e4bae239b894423cb87e63c5a16673b7)
documentation.
4 changes: 2 additions & 2 deletions cmd/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (

var Cmd = &cobra.Command{
Use: "auth",
Short: "Authenticate with the Mynerva API",
Long: "Authenticate with the Mynerva API.",
Short: "Authenticate with the Pathbird API",
Long: "Authenticate with the Pathbird API.",
}
4 changes: 2 additions & 2 deletions cmd/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package auth

import (
"github.com/manifoldco/promptui"
"github.com/mynerva-io/author-cli/internal/auth"
"github.com/pathbird/pbauthor/internal/auth"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

var authLoginCmd = &cobra.Command{
Use: "login",
Short: "Log in to Mynerva",
Short: "Log in to Pathbird",

RunE: func(cmd *cobra.Command, args []string) error {
credentials, err := authLoginPrompt()
Expand Down
2 changes: 1 addition & 1 deletion cmd/auth/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package auth

import (
"fmt"
"github.com/mynerva-io/author-cli/internal/auth"
"github.com/pathbird/pbauthor/internal/auth"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"time"
Expand Down
12 changes: 6 additions & 6 deletions cmd/codex/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package codex
import (
"fmt"
"github.com/fatih/color"
"github.com/mynerva-io/author-cli/internal/api"
"github.com/mynerva-io/author-cli/internal/auth"
"github.com/mynerva-io/author-cli/internal/codex"
"github.com/mynerva-io/author-cli/internal/config"
"github.com/mynerva-io/author-cli/internal/prompt"
"github.com/pathbird/pbauthor/internal/api"
"github.com/pathbird/pbauthor/internal/auth"
"github.com/pathbird/pbauthor/internal/codex"
"github.com/pathbird/pbauthor/internal/config"
"github.com/pathbird/pbauthor/internal/prompt"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"os"
Expand Down Expand Up @@ -74,7 +74,7 @@ var codexUploadCmd = &cobra.Command{
}

fmt.Printf("codexId: %s\n", res.CodexId)
fmt.Printf("url: %s/codex/%s\n", config.MynervaApiHost, res.CodexId)
fmt.Printf("url: %s/codex/%s\n", config.PathbirdApiHost, res.CodexId)

return nil
},
Expand Down
12 changes: 6 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cmd

import (
"fmt"
"github.com/mynerva-io/author-cli/cmd/auth"
"github.com/mynerva-io/author-cli/cmd/codex"
"github.com/mynerva-io/author-cli/internal/config"
"github.com/mynerva-io/author-cli/internal/version"
"github.com/pathbird/pbauthor/cmd/auth"
"github.com/pathbird/pbauthor/cmd/codex"
"github.com/pathbird/pbauthor/internal/config"
"github.com/pathbird/pbauthor/internal/version"
"github.com/spf13/cobra"
"os"

Expand All @@ -18,7 +18,7 @@ var (
)

var rootCmd = &cobra.Command{
Use: "mynerva-author",
Use: "pbauthor",
SilenceErrors: true,
SilenceUsage: true,

Expand All @@ -45,7 +45,7 @@ func Execute() {

func init() {
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "verbose output")
rootCmd.PersistentFlags().StringVar(&config.MynervaApiHost, "api-host", config.MynervaApiHost, "Mynerva API host")
rootCmd.PersistentFlags().StringVar(&config.PathbirdApiHost, "api-host", config.PathbirdApiHost, "Pathbird API host")

rootCmd.AddCommand(versionCmd)
rootCmd.AddCommand(auth.Cmd)
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"github.com/mynerva-io/author-cli/internal/version"
"github.com/pathbird/pbauthor/internal/version"
"github.com/spf13/cobra"
)

Expand Down
34 changes: 17 additions & 17 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Install `mynerva-author`
# Install `pbauthor`

## Install the command line tool

Follow the instructions below for your operating system to install the
`mynerva-author` command line tool. Be sure to follow the
`pbauthor` command line tool. Be sure to follow the
[Verify your installation](#verify-your-installation) steps after following the
OS-specific instructions.

Expand All @@ -14,7 +14,7 @@ Use [Homebrew](https://brew.sh/).
1. [Install Homebrew](https://brew.sh/) (if not already installed).
2. Install the command line tool.
```shell
brew install mynerva-io/tap/mynerva-author
brew install pathbird/tap/pbauthor
```

### Windows
Expand All @@ -33,14 +33,14 @@ Use [Homebrew](https://brew.sh/).
2. Install the command line tool.

```powershell
# Install git (this is required to add the Mynerva bucket)
# Install git (this is required to add the Pathbird bucket)
scoop install git
# Tell scoop where to find Mynerva's published packages
scoop bucket add mynerva https://github.com/mynerva-io/scoop-bucket.git
# Tell scoop where to find Pathbird's published packages
scoop bucket add pathbird https://github.com/pathbird/scoop-bucket.git
# Install the mynerva-author tool
scoop install mynerva/mynerva-author
# Install the pbauthor tool
scoop install pathbird/pbauthor
```

### Custom installation
Expand All @@ -49,23 +49,23 @@ If you're using Linux, or you want more control over your installation, you can
follow these steps.
1. Download the binary from the
[latest GitHub release](https://github.com/mynerva-io/author-cli/releases).
[latest GitHub release](https://github.com/pathbird/pbauthor/releases).
2. Add the executable to your `PATH`. Make sure to set the executable bit if
necessary.
Alternatively, you can download and build the Go source code.
## Verify your installation
1. Log in to Mynerva using the command line tool.
1. Log in to Pathbird using the command line tool.
```shell
# Authenticate with the Mynerva API
# Authenticate with the Pathbird API
# This should prompt you for your email and password
mynerva-author auth login
pbauthor auth login
```
2. Verify that the authentication worked.
```shell
mynerva-author auth status
pbauthor auth status
```
The output should look something like this:
```
Expand All @@ -74,24 +74,24 @@ Alternatively, you can download and build the Go source code.
# Upgrade
The `mynerva-author` command line is periodically updated. It may be necessary
The `pbauthor` command line is periodically updated. It may be necessary
to update your installed version in order to deal with breaking changes in the
Mynerva API or to access newer features.
Pathbird API or to access newer features.
## Upgrade on macOS (Homebrew)
Open a terminal and run this command.
```shell
brew upgrade mynerva-author
brew upgrade pbauthor
```
## Upgrade on Windows (Scoop)
Open PowerShell and run this command.
```powershell
scoop update mynerva-author
scoop update pbauthor
```
## Upgrade custom installation
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/mynerva-io/author-cli
module github.com/pathbird/pbauthor

go 1.15

Expand Down
10 changes: 5 additions & 5 deletions internal/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/mynerva-io/author-cli/internal/config"
"github.com/pathbird/pbauthor/internal/config"
log "github.com/sirupsen/logrus"
"io"
"io/ioutil"
Expand All @@ -21,10 +21,10 @@ type Client struct {
}

func New(authToken string) *Client {
log.Debugf("creating API client using host: %s", config.MynervaApiHost)
log.Debugf("creating API client using host: %s", config.PathbirdApiHost)
return &Client{
authToken: authToken,
host: fmt.Sprintf("%s/api", config.MynervaApiHost),
host: fmt.Sprintf("%s/api", config.PathbirdApiHost),
httpClient: http.DefaultClient,
}
}
Expand Down Expand Up @@ -148,7 +148,7 @@ func (r *response) UnmarshalJson(target interface{}) error {
return nil
}

const userAgent = `mynerva-author-cli`
const userAgent = `pbauthor`

func (c *Client) postJson(r *request) (*response, error) {
reqBody, err := json.Marshal(r.body)
Expand Down Expand Up @@ -193,7 +193,7 @@ func (c *Client) postMultipart(r *multipartRequest) (*response, error) {
}
for _, file := range r.files {
// We just always add files underneath the "files" key since that's what every
// Mynerva API endpoint expects
// Pathbird API endpoint expects
log.Debugf("adding file: %s", file.Name)
err := file.addToWriter("files", w)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func getApiTokenCacheFile() (string, error) {
if err != nil {
return "", errors.Wrap(err, "unable to determine auth file")
}
dir := path.Join(currentUser.HomeDir, ".mynerva")
dir := path.Join(currentUser.HomeDir, ".pathbird")
_ = os.MkdirAll(dir, 0700)
return path.Join(currentUser.HomeDir, ".mynerva", "auth.json"), nil
return path.Join(currentUser.HomeDir, ".pathbird", "auth.json"), nil
}

var authCache = (*Auth)(nil)
Expand Down
8 changes: 4 additions & 4 deletions internal/auth/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"encoding/json"
"fmt"
"github.com/google/martian/log"
"github.com/mynerva-io/author-cli/internal/api"
"github.com/mynerva-io/author-cli/internal/config"
"github.com/pathbird/pbauthor/internal/api"
"github.com/pathbird/pbauthor/internal/config"
"github.com/pkg/errors"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -65,13 +65,13 @@ func apiAuthenticate(email string, password string) (*apiLoginTokenResponse, err
return nil, errors.Wrap(err, "failed to marshal apiLoginRequest")
}

endpoint := fmt.Sprintf("%s%s", config.MynervaApiHost, "/api/auth/login")
endpoint := fmt.Sprintf("%s%s", config.PathbirdApiHost, "/api/auth/login")
req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(reqBody))
if err != nil {
return nil, errors.Wrapf(err, "failed to construct login request")
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("User-Agent", "mynerva-author-cli")
req.Header.Set("User-Agent", "pbauthor")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, errors.Wrap(err, "request to api failed")
Expand Down
6 changes: 3 additions & 3 deletions internal/codex/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package codex

import (
"context"
"github.com/mynerva-io/author-cli/internal/auth"
"github.com/mynerva-io/author-cli/internal/course"
"github.com/mynerva-io/author-cli/internal/graphql"
"github.com/pathbird/pbauthor/internal/auth"
"github.com/pathbird/pbauthor/internal/course"
"github.com/pathbird/pbauthor/internal/graphql"
"github.com/pkg/errors"
"io/ioutil"
"os"
Expand Down
2 changes: 1 addition & 1 deletion internal/codex/upload.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package codex

import (
"github.com/mynerva-io/author-cli/internal/api"
"github.com/pathbird/pbauthor/internal/api"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"os"
Expand Down
6 changes: 3 additions & 3 deletions internal/config/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"strings"
)

var MynervaApiHost = (func() string {
value, set := os.LookupEnv("MYNERVA_API_HOST")
var PathbirdApiHost = (func() string {
value, set := os.LookupEnv("PATHBIRD_API_HOST")
if set {
return strings.TrimRight(value, "/")
}
return "https://mynerva.io"
return "https://pathbird.com"
})()
Loading

0 comments on commit d9c741e

Please sign in to comment.