Browse Source

all: move to mvdan.cc/fdroidcl, merge basedir

I have been moving all github.com/mvdan/... packages to mvdan.cc/...
recently - do this one too.

basedir was only really used by these packages, so merge it in to
simplify building and packaging the tool.
pull/32/head
Daniel Martí 8 years ago
parent
commit
a9b5e6b1db
  1. 2
      .travis.yml
  2. 4
      README.md
  3. 41
      basedir/basedir.go
  4. 17
      basedir/basedir_darwin.go
  5. 19
      basedir/basedir_unix.go
  6. 17
      basedir/basedir_windows.go
  7. 2
      cmd/fdroidcl/devices.go
  8. 2
      cmd/fdroidcl/download.go
  9. 4
      cmd/fdroidcl/install.go
  10. 2
      cmd/fdroidcl/main.go
  11. 4
      cmd/fdroidcl/search.go
  12. 2
      cmd/fdroidcl/show.go
  13. 2
      cmd/fdroidcl/update.go
  14. 4
      cmd/fdroidcl/upgrade.go
  15. 2
      index.go

2
.travis.yml

@ -3,3 +3,5 @@ language: go
go:
- 1.7.x
- 1.8.x
go_import_path: mvdan.cc/fdroidcl

4
README.md

@ -1,11 +1,11 @@
# fdroidcl
[![GoDoc](https://godoc.org/github.com/mvdan/fdroidcl?status.svg)](https://godoc.org/github.com/mvdan/fdroidcl)
[![GoDoc](https://godoc.org/github.com/mvdan/fdroidcl?status.svg)](https://godoc.org/mvdan.cc/fdroidcl)
[![Build Status](https://travis-ci.org/mvdan/fdroidcl.svg?branch=master)](https://travis-ci.org/mvdan/fdroidcl)
[F-Droid](https://f-droid.org/) desktop client.
go get -u github.com/mvdan/fdroidcl/cmd/fdroidcl
go get -u mvdan.cc/fdroidcl/cmd/fdroidcl
This is **not** a replacement for the [Android client](https://gitlab.com/fdroid/fdroidclient).

41
basedir/basedir.go

@ -0,0 +1,41 @@
// Copyright (c) 2015, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
package basedir
import (
"os"
"os/user"
"path/filepath"
)
// Cache returns the base cache directory.
func Cache() string {
return cache()
}
// Data returns the base data directory.
func Data() string {
return data()
}
func firstGetenv(def string, evs ...string) string {
for _, ev := range evs {
if v := os.Getenv(ev); v != "" {
return v
}
}
home, err := homeDir()
if err != nil {
return ""
}
return filepath.Join(home, def)
}
func homeDir() (string, error) {
curUser, err := user.Current()
if err != nil {
return "", err
}
return curUser.HomeDir, nil
}

17
basedir/basedir_darwin.go

@ -0,0 +1,17 @@
// Copyright (c) 2015, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
package basedir
var (
cacheDir = firstGetenv("Library/Caches")
dataDir = firstGetenv("Library/Application Support")
)
func cache() string {
return cacheDir
}
func data() string {
return dataDir
}

19
basedir/basedir_unix.go

@ -0,0 +1,19 @@
// Copyright (c) 2015, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
// +build dragonfly freebsd linux netbsd openbsd
package basedir
var (
cacheDir = firstGetenv(".cache", "XDG_CACHE_HOME")
dataDir = firstGetenv(".config", "XDG_CONFIG_HOME")
)
func cache() string {
return cacheDir
}
func data() string {
return dataDir
}

17
basedir/basedir_windows.go

@ -0,0 +1,17 @@
// Copyright (c) 2015, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information
package basedir
var (
cacheDir = firstGetenv("", "TEMP", "TMP")
dataDir = firstGetenv("", "APPDATA")
)
func cache() string {
return cacheDir
}
func data() string {
return dataDir
}

2
cmd/fdroidcl/devices.go

@ -6,7 +6,7 @@ package main
import (
"fmt"
"github.com/mvdan/fdroidcl/adb"
"mvdan.cc/fdroidcl/adb"
)
var cmdDevices = &Command{

2
cmd/fdroidcl/download.go

@ -7,7 +7,7 @@ import (
"fmt"
"path/filepath"
"github.com/mvdan/fdroidcl"
"mvdan.cc/fdroidcl"
)
var cmdDownload = &Command{

4
cmd/fdroidcl/install.go

@ -6,8 +6,8 @@ package main
import (
"fmt"
"github.com/mvdan/fdroidcl"
"github.com/mvdan/fdroidcl/adb"
"mvdan.cc/fdroidcl"
"mvdan.cc/fdroidcl/adb"
)
var cmdInstall = &Command{

2
cmd/fdroidcl/main.go

@ -11,7 +11,7 @@ import (
"path/filepath"
"strings"
"github.com/mvdan/basedir"
"mvdan.cc/fdroidcl/basedir"
)
const cmdName = "fdroidcl"

4
cmd/fdroidcl/search.go

@ -10,8 +10,8 @@ import (
"strings"
"time"
"github.com/mvdan/fdroidcl"
"github.com/mvdan/fdroidcl/adb"
"mvdan.cc/fdroidcl"
"mvdan.cc/fdroidcl/adb"
)
var cmdSearch = &Command{

2
cmd/fdroidcl/show.go

@ -9,7 +9,7 @@ import (
"strconv"
"strings"
"github.com/mvdan/fdroidcl"
"mvdan.cc/fdroidcl"
)
var cmdShow = &Command{

2
cmd/fdroidcl/update.go

@ -15,7 +15,7 @@ import (
"path/filepath"
"sort"
"github.com/mvdan/fdroidcl"
"mvdan.cc/fdroidcl"
)
var cmdUpdate = &Command{

4
cmd/fdroidcl/upgrade.go

@ -6,8 +6,8 @@ package main
import (
"fmt"
"github.com/mvdan/fdroidcl"
"github.com/mvdan/fdroidcl/adb"
"mvdan.cc/fdroidcl"
"mvdan.cc/fdroidcl/adb"
)
var cmdUpgrade = &Command{

2
index.go

@ -10,7 +10,7 @@ import (
"sort"
"strings"
"github.com/mvdan/fdroidcl/adb"
"mvdan.cc/fdroidcl/adb"
)
type Index struct {

Loading…
Cancel
Save