aboutsummaryrefslogtreecommitdiffstats
path: root/drive
diff options
context:
space:
mode:
Diffstat (limited to 'drive')
-rw-r--r--drive/import.go8
-rw-r--r--drive/share.go2
-rw-r--r--drive/sync_upload.go2
3 files changed, 9 insertions, 3 deletions
diff --git a/drive/import.go b/drive/import.go
index 2ee5f1e..0162aa3 100644
--- a/drive/import.go
+++ b/drive/import.go
@@ -11,15 +11,19 @@ import (
type ImportArgs struct {
Out io.Writer
+ Mime string
Progress io.Writer
Path string
Parents []string
}
func (self *Drive) Import(args ImportArgs) error {
- fromMime := getMimeType(args.Path)
+ fromMime := args.Mime
if fromMime == "" {
- return fmt.Errorf("Could not determine mime type of file")
+ fromMime = getMimeType(args.Path)
+ }
+ if fromMime == "" {
+ return fmt.Errorf("Could not determine mime type of file, use --mime")
}
about, err := self.service.About.Get().Fields("importFormats").Do()
diff --git a/drive/share.go b/drive/share.go
index 69b9c7d..e942c17 100644
--- a/drive/share.go
+++ b/drive/share.go
@@ -13,6 +13,7 @@ type ShareArgs struct {
Role string
Type string
Email string
+ Domain string
Discoverable bool
}
@@ -22,6 +23,7 @@ func (self *Drive) Share(args ShareArgs) error {
Role: args.Role,
Type: args.Type,
EmailAddress: args.Email,
+ Domain: args.Domain,
}
_, err := self.service.Permissions.Create(args.FileId, permission).Do()
diff --git a/drive/sync_upload.go b/drive/sync_upload.go
index 261497d..f1e43a4 100644
--- a/drive/sync_upload.go
+++ b/drive/sync_upload.go
@@ -120,7 +120,7 @@ func (self *Drive) prepareSyncRoot(args UploadSyncArgs) (*drive.File, error) {
// Ensure that the directory is empty
if !isEmpty {
- return nil, fmt.Errorf("Root directoy is not empty, the initial sync requires an empty directory")
+ return nil, fmt.Errorf("Root directory is not empty, the initial sync requires an empty directory")
}
// Update directory with syncRoot property