File tree 5 files changed +6
-18
lines changed
5 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 6
6
"os"
7
7
"path"
8
8
9
- "github.com/alexcoder04/friendly"
9
+ "github.com/alexcoder04/friendly/v2/ffiles "
10
10
)
11
11
12
12
// utils {{{
@@ -16,15 +16,15 @@ func getConfigFile() string {
16
16
17
17
func createConfigFolder () error {
18
18
configFolder := path .Dir (getConfigFile ())
19
- if ! friendly .IsDir (configFolder ) {
19
+ if ! ffiles .IsDir (configFolder ) {
20
20
return os .MkdirAll (configFolder , 0700 )
21
21
}
22
22
return nil
23
23
}
24
24
25
25
func readConfig () (map [string ]string , error ) {
26
26
configFile := getConfigFile ()
27
- if ! friendly .IsFile (configFile ) {
27
+ if ! ffiles .IsFile (configFile ) {
28
28
return map [string ]string {}, nil
29
29
}
30
30
Original file line number Diff line number Diff line change @@ -65,12 +65,9 @@ func Run() {
65
65
fmt .Printf (`{"Description": "%s"}` + "\n " , Plugin .Description )
66
66
case "main" :
67
67
Plugin .Main (Plugin .Data )
68
- break
69
68
case "shutdown" :
70
69
Plugin .Shutdown (Plugin .Data )
71
- break
72
70
default :
73
71
Plugin .Command (Plugin .Data , os .Args [3 :])
74
- break
75
72
}
76
73
}
Original file line number Diff line number Diff line change 4
4
5
5
require (
6
6
github.com/alexcoder04/arrowprint v0.0.1
7
- github.com/alexcoder04/friendly v0 .0.0-20220724153717-2c05924b8c1c
7
+ github.com/alexcoder04/friendly/v2 v2 .0.0
8
8
github.com/mattn/go-colorable v0.1.13
9
9
)
10
10
Original file line number Diff line number Diff line change 1
1
github.com/alexcoder04/arrowprint v0.0.1 h1:JOGDAmow9n1lZJkHFt3qP7vfqKZpmaeifPd9J+eHRac =
2
2
github.com/alexcoder04/arrowprint v0.0.1 /go.mod h1:vscFtiqe8wW9Bd3Gwl5u224YiBUWGL+x2prgtaoDB/U =
3
- github.com/alexcoder04/friendly v0 .0.0-20220724153717-2c05924b8c1c h1:NqI7gPORzOwG/dfv4y/nDi0pZ53XQ2kuTeZpi12LvMs =
4
- github.com/alexcoder04/friendly v0 .0.0-20220724153717-2c05924b8c1c /go.mod h1:mHI5Rm6HB+Jjd69RYJ9/9c7J1qCtfyBvoJPSIm0yslo =
3
+ github.com/alexcoder04/friendly/v2 v2 .0.0 h1:IHSCsqGmfEciPqEM0+xaPKpQ0NAO9GGTKe+GLLkP+Eo =
4
+ github.com/alexcoder04/friendly/v2 v2 .0.0/go.mod h1:mDdl0T9duMHVIVVTDgkXO7TE3rmjR6OO9PMdvEoqIH4 =
5
5
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA =
6
6
github.com/mattn/go-colorable v0.1.13 /go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg =
7
7
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ =
Original file line number Diff line number Diff line change @@ -47,31 +47,22 @@ func Write(msg string) {
47
47
switch c {
48
48
case '0' , '8' :
49
49
fmt .Fprint (out , "\033 [30m" )
50
- break
51
50
case '1' , '9' :
52
51
fmt .Fprint (out , "\033 [34" )
53
- break
54
52
case '2' , 'a' :
55
53
fmt .Fprintf (out , "\033 [32m" )
56
- break
57
54
case '3' , 'b' :
58
55
fmt .Fprintf (out , "\033 [36m" )
59
- break
60
56
case '4' , 'c' :
61
57
fmt .Fprintf (out , "\033 [31m" )
62
- break
63
58
case '5' , 'd' :
64
59
fmt .Fprintf (out , "\033 [35m" )
65
- break
66
60
case '6' , 'e' :
67
61
fmt .Fprintf (out , "\033 [33m" )
68
- break
69
62
case '7' , 'f' :
70
63
fmt .Fprintf (out , "\033 [37m" )
71
- break
72
64
case 'r' :
73
65
fmt .Fprint (out , "\033 [0m" )
74
- break
75
66
default :
76
67
break
77
68
}
You can’t perform that action at this time.
0 commit comments