-
Notifications
You must be signed in to change notification settings - Fork 23
/
util.go
35 lines (29 loc) · 1.38 KB
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"fmt"
"path"
"strings"
)
const logo = `
+-------------+ +----+ +----+ +--------------+ +--------------+ +----+ +----+
| | | | | | | | | | | | | |
| +--------+ | | | | | +----+ | | +---------+ | | | |
| | | +----+ | | | | | | | | | | |
| +--------+ | | | | | | | | | | | |
| | | +----+ | | | | | | | | | | |
+--------+ | | | | | | | | | | | | +---+ +-+
| | | | | | | | | | | | | |
+--------+ | | | | | | +----+ | | +---------+ | +-----+ |
| | | | | | | | | | | | | |
+-------------+ +----+ +----+ +--------------+ +--------------+ +----+ +----+`
func printLogo() {
fmt.Println(logo)
return
}
// Path2uuid extract uuid from path
func Path2uuid(filepath string) string {
ext := path.Ext(filepath) // identify extension
filename := strings.TrimSuffix(filepath, ext) // find filename
uuid := path.Base(filename) // implement basename cmd
return uuid
}