-
Notifications
You must be signed in to change notification settings - Fork 0
/
SSGo.go
62 lines (52 loc) · 956 Bytes
/
SSGo.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"
)
func check(e error) {
if e != nil {
panic(e)
}
}
func main() {
for i := 1; i < len(os.Args); i++ {
switch os.Args[i] {
case "-v", "--version":
fmt.Println("0.0")
case "-t", "--twitch":
fmt.Println("dead chat")
case "-nv", "--nodeVersion":
dat, err := os.ReadFile("go.mod")
check(err)
contents := string(dat[:])
splits := strings.Split(contents, "\n\n")
fmt.Println(splits[len(splits)-1])
default:
fmt.Println("No arg dum-dum")
}
}
//outputDir := "dist"
files, err := ioutil.ReadDir("./")
for _, f := range files {
if !(f.IsDir() && f.Name() == "dist") {
fmt.Println("Making new dist dir")
err = os.Mkdir("dist", 0755)
if err != nil {
log.Fatal(err)
}
break
}
}
/*
files, err = ioutil.ReadDir("./input")
if err != nil {
log.Fatal(err)
}
for _, f := range files {
fmt.Println(f.Name())
}
*/
}