Skip to content

Commit 6c5c2b6

Browse files
committed
fix: generate config schema file path
1 parent 0056abe commit 6c5c2b6

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inspatial/cloud",
3-
"version": "0.5.4",
3+
"version": "0.5.5",
44
"license": "Apache-2.0",
55
"exports": {
66
".": "./mod.ts",

src/cloud-config/cloud-config.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
import { joinPath, normalizePath } from "~/utils/path-utils.ts";
1+
import { joinPath } from "~/utils/path-utils.ts";
22
import type { InCloud } from "~/in-cloud.ts";
33
import type { ConfigDefinition } from "./config-types.ts";
4-
function getPath() {
5-
return normalizePath(Deno.mainModule, {
6-
toDirname: true,
7-
});
8-
}
94
/**
105
* Checks for a cloud-config.json file in the current working directory and loads it to the environment variables.
116
*/
@@ -92,8 +87,7 @@ export function generateConfigSchema(
9287
inCloud: InCloud,
9388
): void {
9489
const filePath = joinPath(
95-
getPath(),
96-
".inspatial",
90+
inCloud.inRoot,
9791
"cloud-config-schema.json",
9892
);
9993
const schema = {
@@ -114,7 +108,7 @@ export function generateConfigSchema(
114108
}
115109

116110
const file = JSON.stringify(schema, null, 2);
117-
Deno.mkdirSync(joinPath(getPath(), ".inspatial"), {
111+
Deno.mkdirSync(inCloud.inRoot, {
118112
recursive: true,
119113
});
120114
Deno.writeTextFileSync(filePath, file);

0 commit comments

Comments
 (0)