From 3252693509fb4641c641e8459a97280a71ec49fb Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Mon, 19 Jun 2023 22:15:14 -0400 Subject: [PATCH] more hugo command drafting --- cmd/obp/cmd/hugo.go | 21 ++++++++++++++++++++- hugo.go | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cmd/obp/cmd/hugo.go b/cmd/obp/cmd/hugo.go index b380143..cc1e5ec 100644 --- a/cmd/obp/cmd/hugo.go +++ b/cmd/obp/cmd/hugo.go @@ -4,11 +4,13 @@ Copyright © 2023 NAME HERE package cmd import ( + "fmt" "log" - // "fmt" "github.com/spf13/cobra" "github.com/spf13/viper" + + "code.ndumas.com/ndumas/obsidian-pipeline" ) var source, target string @@ -22,6 +24,23 @@ var hugoCmd = &cobra.Command{ return nil }, RunE: func(cmd *cobra.Command, args []string) error { + target := viper.GetString("target") + source := viper.GetString("source") + + err := obp.CopyPosts(target, source) + if err != nil { + return fmt.Errorf("error copying posts in %q: %w", source, err) + } + + err = obp.Sanitize(source) + if err != nil { + return fmt.Errorf("error sanitizing posts in %q: %w", source, err) + } + + err = obp.GatherMedia(source) + if err != nil { + return fmt.Errorf("error gathering media in %q: %w", source, err) + } return nil }, } diff --git a/hugo.go b/hugo.go index 6df7de1..7c19731 100644 --- a/hugo.go +++ b/hugo.go @@ -1,6 +1,6 @@ package obp -func Copy(src, dst string) error { +func CopyPosts(src, dst string) error { return nil }