Skip to content

Commit

Permalink
Change default location of temp files for Environments
Browse files Browse the repository at this point in the history
  • Loading branch information
jamnicki committed Oct 29, 2024
1 parent 1dd0784 commit e534000
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/blob/BlobEnvironment.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -76,7 +76,7 @@ export default class BlobEnvironment implements IBlobEnvironment {
}

public async location(): Promise<string> {
const location = this.flags.location || process.cwd();
const location = this.flags.location || join(process.cwd(), '.azurite');
await ensureDir(location);
await access(location);
return location;
Expand Down
3 changes: 2 additions & 1 deletion src/common/Environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from "../table/utils/constants";

import IEnvironment from "./IEnvironment";
import { join } from "path";

args
.option(
Expand Down Expand Up @@ -116,7 +117,7 @@ export default class Environment implements IEnvironment {
}

public async location(): Promise<string> {
return this.flags.location || process.cwd();
return this.flags.location || join(process.cwd(), ".azurite");
}

public silent(): boolean {
Expand Down
3 changes: 2 additions & 1 deletion src/queue/QueueEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
DEFAULT_QUEUE_LISTENING_PORT,
DEFAULT_QUEUE_SERVER_HOST_NAME
} from "./utils/constants";
import { join } from "path";

args
.option(
Expand Down Expand Up @@ -69,7 +70,7 @@ export default class QueueEnvironment implements IQueueEnvironment {
}

public async location(): Promise<string> {
return this.flags.location || process.cwd();
return this.flags.location || join(process.cwd(), ".azurite");
}

public silent(): boolean {
Expand Down
3 changes: 2 additions & 1 deletion src/table/TableEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
DEFAULT_TABLE_LISTENING_PORT,
DEFAULT_TABLE_SERVER_HOST_NAME
} from "./utils/constants";
import { join } from "path";

args
.option(
Expand Down Expand Up @@ -71,7 +72,7 @@ export default class TableEnvironment implements ITableEnvironment {
}

public async location(): Promise<string> {
return this.flags.location || process.cwd();
return this.flags.location || join(process.cwd(), ".azurite");
}

public silent(): boolean {
Expand Down

0 comments on commit e534000

Please sign in to comment.