From 26780273b2a093c6e6a3140d0220d252f0bc709e Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Sun, 23 Feb 2025 13:59:24 +0000 Subject: [PATCH] Rename binary Signed-off-by: Nikolaos Karaolidis --- publish.lua | 4 ++-- src/api.ts | 2 +- src/files.ts | 5 +++-- src/index.ts | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/publish.lua b/publish.lua index 65b85db..e932e8f 100644 --- a/publish.lua +++ b/publish.lua @@ -93,7 +93,7 @@ local function finalize(_, _, extra_data) local files_arg = table.concat(extra_data.exported_files, " ") local command = string.format( - "darktable-publish --title '%s' --slug '%s' %s", + "darktable-ghost-cms-publish --title '%s' --slug '%s' %s", extra_data.title, extra_data.slug, files_arg ) if extra_data.keywords ~= "" then @@ -123,7 +123,7 @@ local function supported(_, _) end dt.register_storage( - "ghost_publish", + "ghost_cms_publish", "publish to Ghost CMS", store, finalize, diff --git a/src/api.ts b/src/api.ts index 89eeabd..cc66c05 100644 --- a/src/api.ts +++ b/src/api.ts @@ -51,7 +51,7 @@ const upload = async ( const key = await getAdminApiKey(); const token = createJwt(key); - const f = Bun.file(path, { type }); + const f = file(path, { type }); const formData = new FormData(); formData.append("file", f); diff --git a/src/files.ts b/src/files.ts index d4e3468..ebd834e 100644 --- a/src/files.ts +++ b/src/files.ts @@ -1,4 +1,5 @@ import { basename, extname } from "path"; +import { file } from "bun"; export interface FileInfo { jpegPath: string; @@ -29,7 +30,7 @@ export const prepareFiles = async (files: string[]): Promise => { const jpegPath = parts[0].replace(/\\:/g, ":"); const rawPath = parts[1]?.replace(/\\:/g, ":"); - const jpegFile = Bun.file(jpegPath); + const jpegFile = file(jpegPath); if (!(await jpegFile.exists())) { throw new Error(`JPEG file not found: ${jpegPath}`); } @@ -47,7 +48,7 @@ export const prepareFiles = async (files: string[]): Promise => { continue; } - const rawFile = Bun.file(rawPath); + const rawFile = file(rawPath); if (!(await rawFile.exists())) { throw new Error(`RAW file not found: ${rawPath}`); } diff --git a/src/index.ts b/src/index.ts index f98cd98..9a34be3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import { uploadFile, uploadImage, uploadPost } from "./api"; import { getBasenameWithExtension, prepareFiles } from "./files"; new Command() - .name("darktable-publish") + .name("darktable-ghost-cms-publish") .description("Publish files to GHOST CMS with optional metadata.") .option("-t, --title [string]", "Specify the title") .option("-s, --slug [string]", "Specify the slug")