mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-22 04:08:49 +02:00
parent
f4d0a61fdc
commit
815ffc2a83
2
Makefile
2
Makefile
@ -71,7 +71,7 @@ favicon:
|
||||
.PHONY: favicon
|
||||
|
||||
serve:
|
||||
@hugo server --enableGitInfo --watch --source www
|
||||
@hugo server --enableGitInfo --watch --source www --disableFastRender
|
||||
.PHONY: serve
|
||||
|
||||
# Show to-do items per file.
|
||||
|
@ -10,9 +10,9 @@ import (
|
||||
)
|
||||
|
||||
// IsRepo returns true if current folder is a git repository
|
||||
func IsRepo() bool {
|
||||
func IsRepo() (bool, error) {
|
||||
out, err := Run("rev-parse", "--is-inside-work-tree")
|
||||
return err == nil && strings.TrimSpace(out) == "true"
|
||||
return err == nil && strings.TrimSpace(out) == "true", err
|
||||
}
|
||||
|
||||
// Run runs a git command and returns its output or errors
|
||||
|
@ -11,7 +11,11 @@ import (
|
||||
|
||||
// remoteRepo gets the repo name from the Git config.
|
||||
func remoteRepo() (result config.Repo, err error) {
|
||||
if !git.IsRepo() {
|
||||
isRepo, err := git.IsRepo()
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
if !isRepo {
|
||||
return result, errors.New("current folder is not a git repository")
|
||||
}
|
||||
out, err := git.Run("config", "--get", "remote.origin.url")
|
||||
|
@ -20,3 +20,8 @@ before:
|
||||
```
|
||||
|
||||
If any of the hooks fails the build process is aborted.
|
||||
|
||||
It is important to note that you can't have "complex" commands, like
|
||||
`bash -c "echo foo bar"` or `foo | bar` or anything like that. If you need
|
||||
to do things that are more complex than just calling a command with some
|
||||
attributes, wrap it in a shell script or into your `Makefile`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user