CLI Deploy

This commit is contained in:
2023-12-10 14:52:00 +08:00
parent c10dfd4c73
commit 5e59bfe912
11 changed files with 223 additions and 18 deletions

View File

@@ -2,11 +2,9 @@ package filesystem
import (
"archive/zip"
"fmt"
"io"
"os"
"path/filepath"
"strings"
)
func Unzip(src, dest string) error {
@@ -35,10 +33,6 @@ func Unzip(src, dest string) error {
path := filepath.Join(dest, f.Name)
if !strings.HasPrefix(path, filepath.Clean(dest)+string(os.PathSeparator)) {
return fmt.Errorf("illegal file path: %s", path)
}
if f.FileInfo().IsDir() {
_ = os.MkdirAll(path, f.Mode())
} else {