Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
prints a help message when buffalo-pop isn't installed but `buffalo d…
Browse files Browse the repository at this point in the history
…b` is called (#1450)
  • Loading branch information
markbates authored Nov 12, 2018
1 parent 219893e commit 7cf917b
Showing 19 changed files with 1,590 additions and 38 deletions.
20 changes: 20 additions & 0 deletions buffalo/cmd/root.go
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ package cmd
import (
"errors"
"os"
"strings"

"github.com/gobuffalo/events"
"github.com/sirupsen/logrus"
@@ -43,11 +44,30 @@ var RootCmd = &cobra.Command{
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
if err := RootCmd.Execute(); err != nil {
if strings.Contains(err.Error(), dbNotFound) || strings.Contains(err.Error(), popNotFound) {
logrus.Errorf(popInstallInstructions)
os.Exit(-1)
}
logrus.Errorf("Error: %s\n\n", err)
os.Exit(-1)
}
}

const dbNotFound = `unknown command "db"`
const popNotFound = `unknown command "pop"`
const popInstallInstructions = `Pop support has been moved to the https://github.com/gobuffalo/buffalo-pop plugin.
Go Get Installation:
$ go get github.com/gobuffalo/buffalo-pop
Buffalo Plugins Installation*:
$ buffalo plugins install github.com/gobuffalo/buffalo-pop
* Requires https://github.com/gobuffalo/buffalo-plugins installed.
`

func init() {
decorate("root", RootCmd)
}
32 changes: 17 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
module github.com/gobuffalo/buffalo

require (
github.com/codegangsta/negroni v1.0.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/gobuffalo/buffalo-plugins v1.6.7
github.com/gobuffalo/buffalo-pop v1.1.8
github.com/gobuffalo/envy v1.6.7
github.com/gobuffalo/events v1.1.5
github.com/gobuffalo/fizz v1.0.16 // indirect
github.com/gobuffalo/genny v0.0.0-20181030163439-ed103521b8ec
github.com/gobuffalo/buffalo-plugins v1.6.10
github.com/gobuffalo/buffalo-pop v1.1.13
github.com/gobuffalo/envy v1.6.8
github.com/gobuffalo/events v1.1.7
github.com/gobuffalo/fizz v1.1.2 // indirect
github.com/gobuffalo/genny v0.0.0-20181111200257-599b33630ab4
github.com/gobuffalo/github_flavored_markdown v1.0.7
github.com/gobuffalo/httptest v1.0.2
github.com/gobuffalo/httptest v1.0.4
github.com/gobuffalo/makr v1.1.5
github.com/gobuffalo/mw-basicauth v1.0.7
github.com/gobuffalo/mw-contenttype v0.0.0-20180802152300-74f5a47f4d56
@@ -21,12 +20,12 @@ require (
github.com/gobuffalo/mw-i18n v0.0.0-20181027200759-09e0c99be4d3
github.com/gobuffalo/mw-paramlogger v0.0.0-20181005191442-d6ee392ec72e
github.com/gobuffalo/mw-tokenauth v0.0.0-20181001105134-8545f626c189
github.com/gobuffalo/packd v0.0.0-20181103221656-16c4ed88b296
github.com/gobuffalo/packd v0.0.0-20181111195323-b2e760a5f0ff
github.com/gobuffalo/packr v1.19.0
github.com/gobuffalo/plush v3.7.22+incompatible
github.com/gobuffalo/pop v4.8.8+incompatible
github.com/gobuffalo/pop v4.9.0+incompatible
github.com/gobuffalo/tags v2.0.11+incompatible
github.com/gobuffalo/x v0.0.0-20181025192250-1ef645d63fe8
github.com/gobuffalo/x v0.0.0-20181110221217-14085ca3e1a9
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v1.6.2
github.com/gorilla/sessions v1.1.3
@@ -36,15 +35,18 @@ require (
github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4
github.com/markbates/refresh v1.4.11
github.com/markbates/sigtx v1.0.0
github.com/mattn/go-sqlite3 v1.10.0 // indirect
github.com/monoculum/formam v0.0.0-20180901015400-4e68be1d79ba
github.com/pkg/errors v0.8.0
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.2.1
github.com/stretchr/testify v1.2.2
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
golang.org/x/tools v0.0.0-20181102223251-96e9e165b75e
gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4
github.com/unrolled/secure v0.0.0-20181022170031-4b6b7cf51606 // indirect
golang.org/x/crypto v0.0.0-20181106171534-e4dc69e5b2fd
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect
golang.org/x/tools v0.0.0-20181111003725-6d71ab8aade0
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
)
83 changes: 61 additions & 22 deletions go.sum

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions mail/internal/mail/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out


# IDE's
.idea/
25 changes: 25 additions & 0 deletions mail/internal/mail/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: go

go:
- 1.2
- 1.3
- 1.4
- 1.5
- 1.6
- 1.7
- 1.8
- 1.9
- master

# safelist
branches:
only:
- master
- v2

notifications:
email: false

before_install:
- mkdir -p $GOPATH/src/gopkg.in &&
ln -s ../github.com/go-mail/mail $GOPATH/src/gopkg.in/mail.v2
83 changes: 83 additions & 0 deletions mail/internal/mail/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## *Unreleased*

## [2.3.0] - 2018-11-10

### Added

- #12: Adds `SendError` to provide additional info about the cause and index of
a failed attempt to transmit a batch of messages.
- go-gomail#78: Adds new `Message` methods for attaching and embedding
`io.Reader`s: `AttachReader` and `EmbedReader`.
- #39: Adds support for Go modules (Go 1.11+).

### Fixed

- #26: Fixes RFC 1341 compliance by properly capitalizing the
`MIME-Version` header.
- #30: Fixes IO errors being silently dropped in `Message.WriteTo`.

## [2.2.0] - 2018-03-01

### Added

- #20: Adds `Message.SetBoundary` to allow specifying a custom MIME boundary.
- #22: Adds `Message.SetBodyWriter` to make it easy to use text/template and
html/template for message bodies. Contributed by Quantcast.
- #25: Adds `Dialer.StartTLSPolicy` so that `MandatoryStartTLS` can be required,
or `NoStartTLS` can disable it. Contributed by Quantcast.

## [2.1.0] - 2017-12-14

### Added

- go-gomail#40: Adds `Dialer.LocalName` field to allow specifying the hostname
sent with SMTP's HELO command.
- go-gomail#47: `Message.SetBody`, `Message.AddAlternative`, and
`Message.AddAlternativeWriter` allow specifying the encoding of message parts.
- `Dialer.Dial`'s returned `SendCloser` automatically redials after a timeout.
- go-gomail#55, go-gomail#56: Adds `Rename` to allow specifying filename
of an attachment.
- go-gomail#100: Exports `NetDialTimeout` to allow setting a custom dialer.
- go-gomail#70: Adds `Dialer.Timeout` field to allow specifying a timeout for
dials, reads, and writes.

### Changed

- go-gomail#52: `Dialer.Dial` automatically uses CRAM-MD5 when available.
- `Dialer.Dial` specifies a default timeout of 10 seconds.
- Gomail is forked from <https://github.com/go-gomail/gomail/> to
<https://github.com/go-mail/mail/>.

### Deprecated

- go-gomail#52: `NewPlainDialer` is deprecated in favor of `NewDialer`.

### Fixed

- go-gomail#41, go-gomail#42: Fixes a panic when a `Message` contains a
nil header.
- go-gomail#44: Fixes `AddAlternativeWriter` replacing the message body instead
of adding a body part.
- go-gomail#53: Folds long header lines for RFC 2047 compliance.
- go-gomail#54: Fixes `Message.FormatAddress` when name is blank.

## [2.0.0] - 2015-09-02

- Mailer has been removed. It has been replaced by Dialer and Sender.
- `File` type and the `CreateFile` and `OpenFile` functions have been removed.
- `Message.Attach` and `Message.Embed` have a new signature.
- `Message.GetBodyWriter` has been removed. Use `Message.AddAlternativeWriter`
instead.
- `Message.Export` has been removed. `Message.WriteTo` can be used instead.
- `Message.DelHeader` has been removed.
- The `Bcc` header field is no longer sent. It is far more simpler and
efficient: the same message is sent to all recipients instead of sending a
different email to each Bcc address.
- LoginAuth has been removed. `NewPlainDialer` now implements the LOGIN
authentication mechanism when needed.
- Go 1.2 is now required instead of Go 1.3. No external dependency are used when
using Go 1.5.
20 changes: 20 additions & 0 deletions mail/internal/mail/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Thank you for contributing to Gomail! Here are a few guidelines:

## Bugs

If you think you found a bug, create an issue and supply the minimum amount
of code triggering the bug so it can be reproduced.


## Fixing a bug

If you want to fix a bug, you can send a pull request. It should contains a
new test or update an existing one to cover that bug.


## New feature proposal

If you think Gomail lacks a feature, you can open an issue or send a pull
request. I want to keep Gomail code and API as simple as possible so please
describe your needs so we can discuss whether this feature should be added to
Gomail or not.
20 changes: 20 additions & 0 deletions mail/internal/mail/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2014 Alexandre Cesaro

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 7cf917b

Please sign in to comment.