From cfcd2d54fd281fd98de881fc6dfbcc6b1b47c855 Mon Sep 17 00:00:00 2001 From: Lacey Pevey <7490308+pevey@users.noreply.github.com> Date: Thu, 11 May 2023 05:32:55 -0500 Subject: [PATCH] fix(medusa-oas-cli): Add separator after tmpdir base (#3924) * add separator after tmpdir base * Create late-badgers-do.md --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> --- .changeset/late-badgers-do.md | 6 ++++++ packages/generated/client-types/scripts/build.ts | 3 ++- packages/oas/medusa-oas-cli/src/utils/fs-utils.ts | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/late-badgers-do.md diff --git a/.changeset/late-badgers-do.md b/.changeset/late-badgers-do.md new file mode 100644 index 0000000000..56bff9b376 --- /dev/null +++ b/.changeset/late-badgers-do.md @@ -0,0 +1,6 @@ +--- +"@medusajs/client-types": patch +"@medusajs/medusa-oas-cli": patch +--- + +Add separator after tmpdir base diff --git a/packages/generated/client-types/scripts/build.ts b/packages/generated/client-types/scripts/build.ts index df7bb096f2..30b4435560 100644 --- a/packages/generated/client-types/scripts/build.ts +++ b/packages/generated/client-types/scripts/build.ts @@ -2,6 +2,7 @@ import execa from "execa" import os from "os" import fs from "fs/promises" import path from "path" +import { sep } from "path" const basePath = path.resolve(__dirname, `../`) @@ -51,7 +52,7 @@ const getTmpDirectory = async () => { * RUNNER_TEMP: GitHub action, the path to a temporary directory on the runner. */ const tmpDir = process.env["RUNNER_TEMP"] ?? os.tmpdir() - return await fs.mkdtemp(tmpDir) + return await fs.mkdtemp(`${tmpDir}${sep}`) } void (async () => { diff --git a/packages/oas/medusa-oas-cli/src/utils/fs-utils.ts b/packages/oas/medusa-oas-cli/src/utils/fs-utils.ts index 65c866676c..e7f19a1dd2 100644 --- a/packages/oas/medusa-oas-cli/src/utils/fs-utils.ts +++ b/packages/oas/medusa-oas-cli/src/utils/fs-utils.ts @@ -1,5 +1,6 @@ import { access, lstat, mkdtemp } from "fs/promises" import path from "path" +import { sep } from "path" import { tmpdir } from "os" export async function isFile(filePath: string): Promise { @@ -25,5 +26,5 @@ export const getTmpDirectory = async () => { * RUNNER_TEMP: GitHub action, the path to a temporary directory on the runner. */ const tmpDir = process.env["RUNNER_TEMP"] ?? tmpdir() - return await mkdtemp(tmpDir) + return await mkdtemp(`${tmpDir}${sep}`) }