Skip to content

Commit

Permalink
Fix bug that called log.Fatal in read metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
orellazri committed Oct 1, 2021
1 parent 4b4b471 commit ea3cd6c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Binary file added gslu.exe
Binary file not shown.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/fatih/color"
)

const VERSION string = "0.1.0"

func clearScreen() {
cmd := exec.Command("cmd", "/c", "cls")
cmd.Stdout = os.Stdout
Expand All @@ -31,7 +33,7 @@ out:
}

fmt.Println("==============================")
fmt.Println("Welcome to GSLU")
fmt.Printf("Welcome to GSLU %s\n", VERSION)
fmt.Println("==============================")
fmt.Println("1) Create a link")
fmt.Println("2) Restore a link")
Expand All @@ -47,7 +49,7 @@ out:
continue
}

ClearScreen()
clearScreen()

switch num {
case 1:
Expand Down
2 changes: 0 additions & 2 deletions metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"encoding/json"
"fmt"
"log"
"os"
)

Expand Down Expand Up @@ -33,7 +32,6 @@ func CreateMetadataFile(dstDir string, metadata Metadata) error {
func ReadMetadataFile(dir string) (*Metadata, error) {
fileBytes, err := os.ReadFile(fmt.Sprintf("%s/%s", dir, METADATA_FILENAME))
if err != nil {
log.Fatalf("Could not read metadata file: %s\n", err.Error())
return nil, err
}

Expand Down

0 comments on commit ea3cd6c

Please sign in to comment.