reworking database, init and add commands

This commit is contained in:
2020-07-02 15:00:30 -04:00
parent 6379c73e38
commit 5af55ed62e
15 changed files with 220 additions and 295 deletions

View File

@@ -7,6 +7,7 @@ import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/deranjer/gvc/common/database"
@@ -95,6 +96,11 @@ func ConvertFileForStorage(file *database.File, folder string) error {
return err
}
fmt.Println("REMOVE: ", fileBytes)
filename := folder + string(filepath.Separator) + file.Name
err = ioutil.WriteFile(filename, fileBytes, 0666)
if err != nil {
return err
}
return nil
}