From e5340008c7eedb75257e8f5853bfe8771e8d8dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Jamnicki?= Date: Tue, 29 Oct 2024 16:49:38 +0100 Subject: [PATCH] Change default location of temp files for Environments --- src/blob/BlobEnvironment.ts | 4 ++-- src/common/Environment.ts | 3 ++- src/queue/QueueEnvironment.ts | 3 ++- src/table/TableEnvironment.ts | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/blob/BlobEnvironment.ts b/src/blob/BlobEnvironment.ts index 65e203828..86e099426 100644 --- a/src/blob/BlobEnvironment.ts +++ b/src/blob/BlobEnvironment.ts @@ -1,6 +1,6 @@ import args from "args"; import { access, ensureDir } from "fs-extra"; -import { dirname } from "path"; +import { dirname, join } from "path"; import IBlobEnvironment from "./IBlobEnvironment"; import { @@ -76,7 +76,7 @@ export default class BlobEnvironment implements IBlobEnvironment { } public async location(): Promise { - const location = this.flags.location || process.cwd(); + const location = this.flags.location || join(process.cwd(), '.azurite'); await ensureDir(location); await access(location); return location; diff --git a/src/common/Environment.ts b/src/common/Environment.ts index 768c53402..fcecb6f08 100644 --- a/src/common/Environment.ts +++ b/src/common/Environment.ts @@ -16,6 +16,7 @@ import { } from "../table/utils/constants"; import IEnvironment from "./IEnvironment"; +import { join } from "path"; args .option( @@ -116,7 +117,7 @@ export default class Environment implements IEnvironment { } public async location(): Promise { - return this.flags.location || process.cwd(); + return this.flags.location || join(process.cwd(), ".azurite"); } public silent(): boolean { diff --git a/src/queue/QueueEnvironment.ts b/src/queue/QueueEnvironment.ts index e169e6788..83708b0bd 100644 --- a/src/queue/QueueEnvironment.ts +++ b/src/queue/QueueEnvironment.ts @@ -5,6 +5,7 @@ import { DEFAULT_QUEUE_LISTENING_PORT, DEFAULT_QUEUE_SERVER_HOST_NAME } from "./utils/constants"; +import { join } from "path"; args .option( @@ -69,7 +70,7 @@ export default class QueueEnvironment implements IQueueEnvironment { } public async location(): Promise { - return this.flags.location || process.cwd(); + return this.flags.location || join(process.cwd(), ".azurite"); } public silent(): boolean { diff --git a/src/table/TableEnvironment.ts b/src/table/TableEnvironment.ts index 73a7f735f..2f0a8c330 100644 --- a/src/table/TableEnvironment.ts +++ b/src/table/TableEnvironment.ts @@ -8,6 +8,7 @@ import { DEFAULT_TABLE_LISTENING_PORT, DEFAULT_TABLE_SERVER_HOST_NAME } from "./utils/constants"; +import { join } from "path"; args .option( @@ -71,7 +72,7 @@ export default class TableEnvironment implements ITableEnvironment { } public async location(): Promise { - return this.flags.location || process.cwd(); + return this.flags.location || join(process.cwd(), ".azurite"); } public silent(): boolean {