mirror of https://gitea.com/webb/interrupt
Clean up before making public
This commit is contained in:
parent
d503eaaac5
commit
756af7cb6f
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
)
|
||||
|
||||
func getUploadKey() (string, error) {
|
||||
PXL_KEY := os.Getenv("PXL_KEY")
|
||||
if PXL_KEY != "" {
|
||||
return PXL_KEY, nil
|
||||
}
|
||||
|
||||
MIRAGE_KEY := os.Getenv("MIRAGE_KEY")
|
||||
if MIRAGE_KEY != "" {
|
||||
return MIRAGE_KEY, nil
|
||||
}
|
||||
|
||||
return "", errors.New("Upload key not set as environment variable!")
|
||||
}
|
21
main.go
21
main.go
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"gitea.com/webb/teal"
|
||||
"os"
|
||||
|
@ -11,24 +10,6 @@ var itCl = teal.Client{
|
|||
UserAgent: "interrupt v0.0.0",
|
||||
}
|
||||
|
||||
func printUsage() {
|
||||
fmt.Println("Usage \n")
|
||||
}
|
||||
|
||||
func getUploadKey() (string, error) {
|
||||
PXL_KEY := os.Getenv("PXL_KEY")
|
||||
if PXL_KEY != "" {
|
||||
return PXL_KEY, nil
|
||||
}
|
||||
|
||||
MIRAGE_KEY := os.Getenv("MIRAGE_KEY")
|
||||
if MIRAGE_KEY != "" {
|
||||
return MIRAGE_KEY, nil
|
||||
}
|
||||
|
||||
return "", errors.New("Upload key not set as environment variable!")
|
||||
}
|
||||
|
||||
func main() {
|
||||
switch os.Args[1] {
|
||||
case "upload":
|
||||
|
@ -36,7 +17,7 @@ func main() {
|
|||
fmt.Println("ERROR: too many arguments!")
|
||||
os.Exit(1)
|
||||
} else if len(os.Args[2:]) == 0 {
|
||||
fmt.Println("Please supply a file to upload.")
|
||||
fmt.Println("ERROR: Please supply a file to upload.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue