diff options
author | Guangxiong Lin <[email protected]> | 2023-01-24 20:27:22 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2023-01-24 20:27:22 +0800 |
commit | 104ee66f5930f4a37ac84538c29a291bf1d08f4f (patch) | |
tree | c663768184594207fd68533a773740d99956c865 /command.go | |
parent | 3f6aeea8c795b8bff59c1a8b45700d7bc44da4b9 (diff) | |
download | zk-104ee66f5930f4a37ac84538c29a291bf1d08f4f.tar.gz zk-104ee66f5930f4a37ac84538c29a291bf1d08f4f.tar.bz2 zk-104ee66f5930f4a37ac84538c29a291bf1d08f4f.zip |
Use cobra as command selector
Diffstat (limited to 'command.go')
-rw-r--r-- | command.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/command.go b/command.go deleted file mode 100644 index 803970b..0000000 --- a/command.go +++ /dev/null @@ -1,32 +0,0 @@ -package main - -import ( - "os" - "path/filepath" -) - -func Rename(source, target string) { - source, err := filepath.Abs(source) - if err != nil { - panic("Unable to get abspath of " + source) - } - - target, err = filepath.Abs(target) - if err != nil { - panic("Unable to get abspath of " + target) - } - - if !DocCollection.Contain(source) { - panic("Database doesn't contain " + source) - } - - if err := os.Rename(source, target); err != nil { - panic(err) - } - - doc := DocCollection[source] - for backlink := range doc.backlinks { - DocCollection[backlink].UpdateLinks(source, target) - } - -} |