From c43d8889df6e4538eb8fce0c797b69b5431dc7dc Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Sat, 25 Sep 2021 13:13:41 +0100 Subject: [PATCH] refactor: project rename --- .gitignore | 2 +- LICENSE | 4 ++-- README.md | 10 +++++----- cmd/{pelican => canal}/main.go | 2 +- go.mod | 2 +- internal/board/board.go | 2 +- internal/board/board_test.go | 2 +- internal/database/database.go | 12 ++++++------ internal/database/database_test.go | 6 +++--- internal/ui/ui.go | 2 +- magefile.go | 12 ++++++------ 11 files changed, 28 insertions(+), 28 deletions(-) rename cmd/{pelican => canal}/main.go (66%) diff --git a/.gitignore b/.gitignore index a8ad0d7..a3835e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /test/databases/*.db -/pelican +/canal diff --git a/LICENSE b/LICENSE index 71773c6..78a673a 100644 --- a/LICENSE +++ b/LICENSE @@ -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 the "copyright" line and a pointer to where the full notice is found. - Pelican + Canal Copyright (C) 2021 Dan Anglin 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 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 is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index ebe6a68..3d1bcde 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# Pelican +# Canal ## Summary -Pelican is a simple Kanban board for your terminal. +Canal is a simple Kanban board for your terminal. ## Storage 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 -If $XDG\_DATA\_HOME is not set then the default location is $HOME/.local/share/pelican/pelican.db by default. -For all other operating systems the default location is $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/canal/canal.db by default. +For all other operating systems the default location is $HOME/.canal/canal.db. ## Keybindings diff --git a/cmd/pelican/main.go b/cmd/canal/main.go similarity index 66% rename from cmd/pelican/main.go rename to cmd/canal/main.go index e8ba2fa..568ed01 100644 --- a/cmd/pelican/main.go +++ b/cmd/canal/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "forge.dananglin.me.uk/code/dananglin/pelican/internal/ui" + "forge.dananglin.me.uk/code/dananglin/canal/internal/ui" ) func main() { diff --git a/go.mod b/go.mod index de79f56..faa6e57 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module forge.dananglin.me.uk/code/dananglin/pelican +module forge.dananglin.me.uk/code/dananglin/canal go 1.16 diff --git a/internal/board/board.go b/internal/board/board.go index 2bcbeec..9e03e81 100644 --- a/internal/board/board.go +++ b/internal/board/board.go @@ -6,7 +6,7 @@ import ( "fmt" "sort" - "forge.dananglin.me.uk/code/dananglin/pelican/internal/database" + "forge.dananglin.me.uk/code/dananglin/canal/internal/database" bolt "go.etcd.io/bbolt" ) diff --git a/internal/board/board_test.go b/internal/board/board_test.go index 859d6cd..c4d685b 100644 --- a/internal/board/board_test.go +++ b/internal/board/board_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - "forge.dananglin.me.uk/code/dananglin/pelican/internal/board" + "forge.dananglin.me.uk/code/dananglin/canal/internal/board" bolt "go.etcd.io/bbolt" ) diff --git a/internal/database/database.go b/internal/database/database.go index 21d87e0..80862bf 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -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. -// For linux, the default location of the database file is $XDG_DATA_HOME/pelican/pelican.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 -// location is $HOME/.pelican/pelican.db. +// 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/canal/canal.db. For all other operating systems the default +// location is $HOME/.canal/canal.db. func dbPath(path string) string { if len(path) > 0 { filepath.Dir(path) @@ -202,7 +202,7 @@ func dbPath(path string) string { return path } - dbFilename := "pelican.db" + dbFilename := "canal.db" var dataDir string @@ -215,9 +215,9 @@ func dbPath(path string) string { dataHome = filepath.Join(os.Getenv("HOME"), ".local", "share") } - dataDir = filepath.Join(dataHome, "pelican") + dataDir = filepath.Join(dataHome, "canal") default: - dataDir = filepath.Join(os.Getenv("HOME"), ".pelican") + dataDir = filepath.Join(os.Getenv("HOME"), ".canal") } path = filepath.Join(dataDir, dbFilename) diff --git a/internal/database/database_test.go b/internal/database/database_test.go index 1789c71..d7576d3 100644 --- a/internal/database/database_test.go +++ b/internal/database/database_test.go @@ -9,8 +9,8 @@ import ( "reflect" "testing" - "forge.dananglin.me.uk/code/dananglin/pelican/internal/board" - "forge.dananglin.me.uk/code/dananglin/pelican/internal/database" + "forge.dananglin.me.uk/code/dananglin/canal/internal/board" + "forge.dananglin.me.uk/code/dananglin/canal/internal/database" bolt "go.etcd.io/bbolt" ) @@ -40,7 +40,7 @@ func TestOpenDataBaseXDGDataDir(t *testing.T) { _ = db.Close() - wantDB := filepath.Join(testXdgDataHome, "pelican", "pelican.db") + wantDB := filepath.Join(testXdgDataHome, "canal", "canal.db") // ensure that the database file exists _, err = os.Stat(wantDB) diff --git a/internal/ui/ui.go b/internal/ui/ui.go index 78a5d56..8bddc19 100644 --- a/internal/ui/ui.go +++ b/internal/ui/ui.go @@ -4,7 +4,7 @@ package ui import ( "fmt" - "forge.dananglin.me.uk/code/dananglin/pelican/internal/board" + "forge.dananglin.me.uk/code/dananglin/canal/internal/board" "github.com/eiannone/keyboard" bolt "go.etcd.io/bbolt" ) diff --git a/magefile.go b/magefile.go index c13d959..6bc532a 100644 --- a/magefile.go +++ b/magefile.go @@ -11,24 +11,24 @@ import ( ) const ( - binary = "pelican" + binary = "canal" ) var Default = Build // Test run the go tests -// To enable verbose mode set PELICAN_TEST_VERBOSE=1. -// To enable coverage mode set PELICAN_TEST_COVER=1. +// To enable verbose mode set CANAL_TEST_VERBOSE=1. +// To enable coverage mode set CANAL_TEST_COVER=1. func Test() error { goTest := sh.RunCmd("go", "test") args := []string{"./..."} - if os.Getenv("PELICAN_TEST_VERBOSE") == "1" { + if os.Getenv("CANAL_TEST_VERBOSE") == "1" { args = append(args, "-v") } - if os.Getenv("PELICAN_TEST_COVER") == "1" { + if os.Getenv("CANAL_TEST_COVER") == "1" { args = append(args, "-cover") } @@ -42,7 +42,7 @@ func Lint() error { // Build build the executable func Build() error { - main := "./cmd/pelican/main.go" + main := "./cmd/canal/main.go" return sh.Run("go", "build", "-o", binary, main) }