~emersion/hut

499ef88754326222b1567261ac6b39b9f2a586ed — delthas 5 months ago 788b7e2
import: Fix wrong import path

FindDirResources returns a list of resources, with paths pointing
to dirs containing an info.json

ImportResource was incorrectly taking the Dir of that path, but
the path is already the right one, we should not take the Dir.

import was effectively broken before this patch.
1 files changed, 1 insertions(+), 2 deletions(-)

M import.go
M import.go => import.go +1 -2
@@ 4,7 4,6 @@ import (
	"github.com/spf13/cobra"
	"log"
	"os"
	"path/filepath"

	"git.sr.ht/~emersion/hut/export"
)


@@ 71,7 70,7 @@ func newImportCommand() *cobra.Command {
			}

			log.Printf("\t%s", res.Name)
			if err := importer.ImportResource(ctx, filepath.Dir(res.Path)); err != nil {
			if err := importer.ImportResource(ctx, res.Path); err != nil {
				log.Printf("Error importing %q: %v", res.Path, err)
			}
		}