Skip to content

Commit

Permalink
fix: adopt license suggestions from #294
Browse files Browse the repository at this point in the history
remove CC disclaimer thats not actually part of license and add suggested publishing country
  • Loading branch information
zaquestion committed Aug 30, 2019
1 parent 118fa13 commit d114488
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
9 changes: 0 additions & 9 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ Creative Commons Legal Code

CC0 1.0 Universal

CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,8 @@ alias git=lab
<span property="dct:title">Zaq? Wiedmann</span></a>
has waived all copyright and related or neighboring rights to
<span property="dct:title">Lab</span>.
This work is published from:
<span property="vcard:Country" datatype="dct:ISO3166"
content="US" about="https://github.com/zaquestion/lab">
United States</span>.
</p>
25 changes: 10 additions & 15 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,19 @@ import (
gitlab "github.com/xanzy/go-gitlab"
"github.com/zaquestion/lab/cmd"
"github.com/zaquestion/lab/internal/config"
"github.com/zaquestion/lab/internal/git"
lab "github.com/zaquestion/lab/internal/gitlab"
)

// version gets set on releases during build by goreleaser.
var version = "master"

func loadConfig() (string, string, string) {
var home string
switch runtime.GOOS {
case "windows":
// userprofile works for roaming AD profiles
home = os.Getenv("USERPROFILE")
default:
// Assume linux or osx
home = os.Getenv("HOME")
if home == "" {
u, err := user.Current()
if err != nil {
log.Fatalf("cannot retrieve current user: %v \n", err)
}
home = u.HomeDir
}
home, err := os.UserHomeDir()
if err != nil {
log.Fatal(err)
}

// Try XDG_CONFIG_HOME which is declared in XDG base directory specification
confpath := os.Getenv("XDG_CONFIG_HOME")
if confpath == "" {
Expand All @@ -48,6 +38,11 @@ func loadConfig() (string, string, string) {
viper.SetConfigType("hcl")
viper.AddConfigPath(".")
viper.AddConfigPath(confpath)
gitDir, err := git.GitDir()
if err != nil {
log.Fatal(err)
}
viper.AddConfigPath(gitDir)

viper.SetEnvPrefix("LAB")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
Expand Down

0 comments on commit d114488

Please sign in to comment.