Skip to content

Commit

Permalink
Merge branch 'master' into globbing
Browse files Browse the repository at this point in the history
  • Loading branch information
ddvk committed Sep 24, 2024
2 parents 702474f + 52c6d12 commit 5f8bea5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion archive/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (d *DocumentFiles) AddMap(name, filepath string) {
// Prepare prepares a file for uploading (creates needed temp files or unpacks a zip)
func Prepare(name, parentId, sourceDocPath, ext, tmpDir string) (files *DocumentFiles, id string, err error) {
files = &DocumentFiles{}
if ext == util.ZIP {
if ext == util.ZIP || ext == util.RMDOC {
var metadataPath string
id, files, metadataPath, err = Unpack(sourceDocPath, tmpDir)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion shell/mget.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/abiosoft/ishell"
"github.com/juruen/rmapi/filetree"
"github.com/juruen/rmapi/model"
"github.com/juruen/rmapi/util"
)

func mgetCmd(ctx *ShellCtxt) *ishell.Cmd {
Expand Down Expand Up @@ -62,7 +63,7 @@ func mgetCmd(ctx *ShellCtxt) *ishell.Cmd {
idxDir = 1
}

fileName := currentNode.Name() + ".zip"
fileName := fmt.Sprintf("%s.%s",currentNode.Name(), util.RMDOC)

dst := path.Join(target, filetree.BuildPath(currentPath[idxDir:], fileName))
fileMap[dst] = struct{}{}
Expand Down
5 changes: 3 additions & 2 deletions shell/mput.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/abiosoft/ishell"
"github.com/juruen/rmapi/log"
"github.com/juruen/rmapi/util"
flag "github.com/ogier/pflag"
"flag"
)

func mputCmd(ctx *ShellCtxt) *ishell.Cmd {
Expand All @@ -20,7 +20,7 @@ func mputCmd(ctx *ShellCtxt) *ishell.Cmd {
Completer: createFsEntryCompleter(),
Func: func(c *ishell.Context) {
flagSet := flag.NewFlagSet("mput", flag.ContinueOnError)
src := flagSet.StringP("src", "s", "", "source dir")
src := flagSet.String("src", "", "source dir")

if err := flagSet.Parse(c.Args); err != nil {
if err != flag.ErrHelp {
Expand All @@ -41,6 +41,7 @@ func mputCmd(ctx *ShellCtxt) *ishell.Cmd {
}

dst := argRest[0]
fmt.Println("dest:", dst)

// Past this point, the number of arguments is 1.

Expand Down

0 comments on commit 5f8bea5

Please sign in to comment.