From 6863b43360c65dd832d4f2c072d5655e06f58a4b Mon Sep 17 00:00:00 2001 From: studiokaiji Date: Thu, 9 Nov 2023 04:19:20 +0900 Subject: [PATCH] =?UTF-8?q?addNostrEventQueue=E5=86=85=E3=81=ABAdded=20pri?= =?UTF-8?q?nt=E6=96=87=E3=82=92=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hostr/cmd/deploy/deploy.go | 20 ++++++++++++++++---- hostr/cmd/deploy/nostr.go | 3 ++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/hostr/cmd/deploy/deploy.go b/hostr/cmd/deploy/deploy.go index 3247a73..064819b 100644 --- a/hostr/cmd/deploy/deploy.go +++ b/hostr/cmd/deploy/deploy.go @@ -72,6 +72,19 @@ func Deploy(basePath string, replaceable bool, htmlIdentifier string) (string, s return "", "", "", err } + // basePath以下のText Fileのパスをすべて羅列する + err = generateEventsAndAddQueueAllValidStaticTextFiles( + priKey, + pubKey, + htmlIdentifier, + basePath, + replaceable, + ) + if err != nil { + fmt.Println("❌ Failed to convert text files:", err) + return "", "", "", err + } + // basePath以下のMedia Fileのパスを全て羅列しアップロード err = uploadAllValidStaticMediaFiles(priKey, pubKey, basePath) if err != nil { @@ -106,8 +119,8 @@ func Deploy(basePath string, replaceable bool, htmlIdentifier string) (string, s fmt.Println("❌ Failed to get public key:", err) return "", "", "", err } - addNostrEventQueue(event) - fmt.Println("Added", filePath, "event to publish queue") + + addNostrEventQueue(event, filePath) eventId, encoded := publishEventsFromQueue(replaceable) @@ -168,8 +181,7 @@ func convertLinks( break } - addNostrEventQueue(event) - fmt.Println("Added", filePath, "event to publish queue") + addNostrEventQueue(event, filePath) // 置き換え可能なイベントでない場合 if !replaceable { diff --git a/hostr/cmd/deploy/nostr.go b/hostr/cmd/deploy/nostr.go index 91659a0..468edae 100644 --- a/hostr/cmd/deploy/nostr.go +++ b/hostr/cmd/deploy/nostr.go @@ -140,6 +140,7 @@ func getReplaceableIdentifier(indexHtmlIdentifier, filePath string) string { var nostrEventsQueue []*nostr.Event -func addNostrEventQueue(event *nostr.Event) { +func addNostrEventQueue(event *nostr.Event, filePath string) { nostrEventsQueue = append(nostrEventsQueue, event) + fmt.Println("Added", filePath, "event to publish queue") }