From cece0c85fa7f8b22a1b7022f11701a55f2941fbb Mon Sep 17 00:00:00 2001 From: Jack Hamer Date: Wed, 20 Nov 2024 17:08:12 +0200 Subject: [PATCH] fix: copy readme from root during deployment --- packages/sdk/.gitignore | 3 ++- packages/sdk/prepare-package.mjs | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/sdk/.gitignore b/packages/sdk/.gitignore index aa66385e..523ba8ed 100644 --- a/packages/sdk/.gitignore +++ b/packages/sdk/.gitignore @@ -2,4 +2,5 @@ dist node_modules tsconfig*.tsbuildinfo -.DS_Store \ No newline at end of file +.DS_Store +README.md \ No newline at end of file diff --git a/packages/sdk/prepare-package.mjs b/packages/sdk/prepare-package.mjs index 9afa3e29..7e65f632 100644 --- a/packages/sdk/prepare-package.mjs +++ b/packages/sdk/prepare-package.mjs @@ -8,6 +8,7 @@ if (!version) { } const packageJsonPath = path.resolve("./package.json"); +const readmePath = path.resolve("../../README.md"); // copy readme into current path async function preparePackageJson() { try { @@ -32,4 +33,14 @@ async function preparePackageJson() { } } +async function copyReadme() { + try { + await fs.copyFile(readmePath, path.resolve("./README.md")); + } catch (error) { + console.error("Error copying README.md:", error); + process.exit(1); + } +} + preparePackageJson(); +copyReadme();