Add CLI Flag and update Function Flow

This commit is contained in:
Stefan Benten
2019-03-19 11:35:30 +01:00
parent e7e894dd7f
commit 7be8c21044
2 changed files with 20 additions and 16 deletions

View File

@ -2,15 +2,13 @@ package cmd
import (
"fmt"
"log"
"os"
"strings"
"github.com/dutchcoders/transfer.sh/server"
"github.com/fatih/color"
"github.com/minio/cli"
"log"
"google.golang.org/api/googleapi"
)
@ -117,6 +115,10 @@ var globalFlags = []cli.Flag{
Value: "",
EnvVar: "BUCKET",
},
cli.BoolFlag{
Name: "no-multipart",
Usage: "Disables Multipart Puts",
},
cli.StringFlag{
Name: "gdrive-client-json-filepath",
Usage: "",
@ -294,7 +296,7 @@ func New() *Cmd {
panic("secret-key not set.")
} else if bucket := c.String("bucket"); bucket == "" {
panic("bucket not set.")
} else if storage, err := server.NewS3Storage(accessKey, secretKey, bucket, c.String("s3-endpoint"), logger); err != nil {
} else if storage, err := server.NewS3Storage(accessKey, secretKey, bucket, c.String("s3-endpoint"), logger, c.Bool("no-multipart")); err != nil {
panic(err)
} else {
options = append(options, server.UseStorage(storage))