refactor: project rename

This commit is contained in:
Dan Anglin 2021-09-25 13:13:41 +01:00
parent 0e186be66b
commit c43d8889df
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
11 changed files with 28 additions and 28 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
/test/databases/*.db /test/databases/*.db
/pelican /canal

View file

@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
Pelican Canal
Copyright (C) 2021 Dan Anglin Copyright (C) 2021 Dan Anglin
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode: notice like this when it starts in an interactive mode:
Pelican Copyright (C) 2021 Dan Anglin Canal Copyright (C) 2021 Dan Anglin
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details. under certain conditions; type `show c' for details.

View file

@ -1,15 +1,15 @@
# Pelican # Canal
## Summary ## Summary
Pelican is a simple Kanban board for your terminal. Canal is a simple Kanban board for your terminal.
## Storage ## Storage
Data is stored in a [BoltDB](https://github.com/etcd-io/bbolt) database. Data is stored in a [BoltDB](https://github.com/etcd-io/bbolt) database.
For Linux the default the database file is located at $XDG\_DATA\_HOME/pelican/pelican.db For Linux the default the database file is located at $XDG\_DATA\_HOME/canal/canal.db
If $XDG\_DATA\_HOME is not set then the default location is $HOME/.local/share/pelican/pelican.db by default. If $XDG\_DATA\_HOME is not set then the default location is $HOME/.local/share/canal/canal.db by default.
For all other operating systems the default location is $HOME/.pelican/pelican.db. For all other operating systems the default location is $HOME/.canal/canal.db.
## Keybindings ## Keybindings

View file

@ -3,7 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"forge.dananglin.me.uk/code/dananglin/pelican/internal/ui" "forge.dananglin.me.uk/code/dananglin/canal/internal/ui"
) )
func main() { func main() {

2
go.mod
View file

@ -1,4 +1,4 @@
module forge.dananglin.me.uk/code/dananglin/pelican module forge.dananglin.me.uk/code/dananglin/canal
go 1.16 go 1.16

View file

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"sort" "sort"
"forge.dananglin.me.uk/code/dananglin/pelican/internal/database" "forge.dananglin.me.uk/code/dananglin/canal/internal/database"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
) )

View file

@ -7,7 +7,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"forge.dananglin.me.uk/code/dananglin/pelican/internal/board" "forge.dananglin.me.uk/code/dananglin/canal/internal/board"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
) )

View file

@ -192,9 +192,9 @@ func Read(db *bolt.DB, bucketName string, id int) ([]byte, error) {
} }
// dbPath returns the path to the database file. If a path is given then that is returned. Otherwise the default path is returned. // dbPath returns the path to the database file. If a path is given then that is returned. Otherwise the default path is returned.
// For linux, the default location of the database file is $XDG_DATA_HOME/pelican/pelican.db. If the XDG_DATA_HOME environment // For linux, the default location of the database file is $XDG_DATA_HOME/canal/canal.db. If the XDG_DATA_HOME environment
// variable is not set then it will default to $HOME/.local/share/pelican/pelican.db. For all other operating systems the default // variable is not set then it will default to $HOME/.local/share/canal/canal.db. For all other operating systems the default
// location is $HOME/.pelican/pelican.db. // location is $HOME/.canal/canal.db.
func dbPath(path string) string { func dbPath(path string) string {
if len(path) > 0 { if len(path) > 0 {
filepath.Dir(path) filepath.Dir(path)
@ -202,7 +202,7 @@ func dbPath(path string) string {
return path return path
} }
dbFilename := "pelican.db" dbFilename := "canal.db"
var dataDir string var dataDir string
@ -215,9 +215,9 @@ func dbPath(path string) string {
dataHome = filepath.Join(os.Getenv("HOME"), ".local", "share") dataHome = filepath.Join(os.Getenv("HOME"), ".local", "share")
} }
dataDir = filepath.Join(dataHome, "pelican") dataDir = filepath.Join(dataHome, "canal")
default: default:
dataDir = filepath.Join(os.Getenv("HOME"), ".pelican") dataDir = filepath.Join(os.Getenv("HOME"), ".canal")
} }
path = filepath.Join(dataDir, dbFilename) path = filepath.Join(dataDir, dbFilename)

View file

@ -9,8 +9,8 @@ import (
"reflect" "reflect"
"testing" "testing"
"forge.dananglin.me.uk/code/dananglin/pelican/internal/board" "forge.dananglin.me.uk/code/dananglin/canal/internal/board"
"forge.dananglin.me.uk/code/dananglin/pelican/internal/database" "forge.dananglin.me.uk/code/dananglin/canal/internal/database"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
) )
@ -40,7 +40,7 @@ func TestOpenDataBaseXDGDataDir(t *testing.T) {
_ = db.Close() _ = db.Close()
wantDB := filepath.Join(testXdgDataHome, "pelican", "pelican.db") wantDB := filepath.Join(testXdgDataHome, "canal", "canal.db")
// ensure that the database file exists // ensure that the database file exists
_, err = os.Stat(wantDB) _, err = os.Stat(wantDB)

View file

@ -4,7 +4,7 @@ package ui
import ( import (
"fmt" "fmt"
"forge.dananglin.me.uk/code/dananglin/pelican/internal/board" "forge.dananglin.me.uk/code/dananglin/canal/internal/board"
"github.com/eiannone/keyboard" "github.com/eiannone/keyboard"
bolt "go.etcd.io/bbolt" bolt "go.etcd.io/bbolt"
) )

View file

@ -11,24 +11,24 @@ import (
) )
const ( const (
binary = "pelican" binary = "canal"
) )
var Default = Build var Default = Build
// Test run the go tests // Test run the go tests
// To enable verbose mode set PELICAN_TEST_VERBOSE=1. // To enable verbose mode set CANAL_TEST_VERBOSE=1.
// To enable coverage mode set PELICAN_TEST_COVER=1. // To enable coverage mode set CANAL_TEST_COVER=1.
func Test() error { func Test() error {
goTest := sh.RunCmd("go", "test") goTest := sh.RunCmd("go", "test")
args := []string{"./..."} args := []string{"./..."}
if os.Getenv("PELICAN_TEST_VERBOSE") == "1" { if os.Getenv("CANAL_TEST_VERBOSE") == "1" {
args = append(args, "-v") args = append(args, "-v")
} }
if os.Getenv("PELICAN_TEST_COVER") == "1" { if os.Getenv("CANAL_TEST_COVER") == "1" {
args = append(args, "-cover") args = append(args, "-cover")
} }
@ -42,7 +42,7 @@ func Lint() error {
// Build build the executable // Build build the executable
func Build() error { func Build() error {
main := "./cmd/pelican/main.go" main := "./cmd/canal/main.go"
return sh.Run("go", "build", "-o", binary, main) return sh.Run("go", "build", "-o", binary, main)
} }