feat: Added initial support for .zip
All checks were successful
CI / build (push) Successful in 2m3s

This commit is contained in:
2024-09-02 22:37:38 +12:00
parent 1cef099a37
commit 3c5014e90b
3 changed files with 65 additions and 4 deletions

View File

@@ -4,6 +4,8 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
)
func MoveFile(src, dst string) error {
@@ -39,9 +41,18 @@ func MoveFile(src, dst string) error {
return fmt.Errorf("chmod error: %s", err)
}
//err = in.Close()
//if err != nil {
// return fmt.Errorf("closing file failed: %s", err)
//}
//time.Sleep(time.Second * 10)
err = os.Remove(src)
if err != nil {
return fmt.Errorf("failed removing original file: %s", err)
}
return nil
}
func FileNameWithoutExt(fileName string) string {
return strings.TrimSuffix(fileName, filepath.Ext(fileName))
}