Skip to content

Commit

Permalink
Merge pull request #1037 from jinroh/remove-default-konnector-path
Browse files Browse the repository at this point in the history
Comment-out default konnector path
  • Loading branch information
jinroh authored Nov 6, 2017
2 parents 6d7a82e + 58220ed commit 58f34c2
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions pkg/workers/exec/konnector.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"io"
"os"
"path"
"strings"
"time"

"github.com/cozy/cozy-stack/pkg/apps"
Expand All @@ -17,9 +16,7 @@ import (
"github.com/cozy/cozy-stack/pkg/couchdb"
"github.com/cozy/cozy-stack/pkg/instance"
"github.com/cozy/cozy-stack/pkg/jobs"
"github.com/cozy/cozy-stack/pkg/logger"
"github.com/cozy/cozy-stack/pkg/realtime"
"github.com/cozy/cozy-stack/pkg/vfs"
"github.com/sirupsen/logrus"

"github.com/spf13/afero"
Expand Down Expand Up @@ -97,30 +94,30 @@ func (w *konnectorWorker) PrepareWorkDir(ctx *jobs.WorkerContext, i *instance.In
}

// Create the folder in which the konnector has the right to write.
{
fs := i.VFS()
folderToSave, _ := msg["folder_to_save"].(string)
if folderToSave != "" {
if _, err = fs.DirByID(folderToSave); os.IsNotExist(err) {
folderToSave = ""
}
}
if folderToSave == "" {
defaultFolderPath, _ := msg["default_folder_path"].(string)
if defaultFolderPath == "" {
name := i.Translate("Tree Administrative")
defaultFolderPath = fmt.Sprintf("/%s/%s", name, strings.Title(slug))
}
var dir *vfs.DirDoc
dir, err = vfs.MkdirAll(fs, defaultFolderPath, nil)
if err != nil {
log := logger.WithDomain(i.Domain)
log.Warnf("Can't create the default folder %s for konnector %s: %s", defaultFolderPath, slug, err)
return
}
msg["folder_to_save"] = dir.ID()
}
}
// {
// fs := i.VFS()
// folderToSave, _ := msg["folder_to_save"].(string)
// if folderToSave != "" {
// if _, err = fs.DirByID(folderToSave); os.IsNotExist(err) {
// folderToSave = ""
// }
// }
// if folderToSave == "" {
// defaultFolderPath, _ := msg["default_folder_path"].(string)
// if defaultFolderPath == "" {
// name := i.Translate("Tree Administrative")
// defaultFolderPath = fmt.Sprintf("/%s/%s", name, strings.Title(slug))
// }
// var dir *vfs.DirDoc
// dir, err = vfs.MkdirAll(fs, defaultFolderPath, nil)
// if err != nil {
// log := logger.WithDomain(i.Domain)
// log.Warnf("Can't create the default folder %s for konnector %s: %s", defaultFolderPath, slug, err)
// return
// }
// msg["folder_to_save"] = dir.ID()
// }
// }

tr := tar.NewReader(tarFile)
for {
Expand Down

0 comments on commit 58f34c2

Please sign in to comment.