Skip to content

Commit 330022f

Browse files
committed
Merge branch 'develop'
2 parents a234442 + a933654 commit 330022f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

cli/incloud.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function doRun(rootPath: string, file?: string) {
6868
runner.init();
6969
}
7070

71-
function doInit(_rootPath: string, projectName?: string) {
71+
async function doInit(_rootPath: string, projectName?: string) {
7272
if (!projectName) {
7373
cliLog.warn("Project name is required for initialization.");
7474
Deno.exit(1);
@@ -117,9 +117,15 @@ function doInit(_rootPath: string, projectName?: string) {
117117
},
118118
}),
119119
);
120-
proc.status.then((status) => {
120+
try {
121+
const status = await proc.status;
121122
Deno.writeTextFileSync("main.ts", makeMainFile(projectName));
122123
if (status.success) {
124+
const cmd = new Deno.Command(Deno.execPath(), {
125+
args: ["cache", "--reload", "main.ts"],
126+
});
127+
await cmd.output();
128+
123129
cliLog.info([
124130
`Project ${name} initialized successfully!`,
125131
"",
@@ -131,10 +137,11 @@ function doInit(_rootPath: string, projectName?: string) {
131137
cliLog.error(`Failed to initialize project ${name}.`);
132138
Deno.exit(1);
133139
}
134-
}).catch((err) => {
135-
cliLog.error(`Error initializing project: ${err.message}`);
140+
} catch (err) {
141+
const message = err instanceof Error ? err.message : String(err);
142+
cliLog.error(`Error initializing project: ${message}`);
136143
Deno.exit(1);
137-
});
144+
}
138145
}
139146

140147
async function init() {
@@ -156,7 +163,7 @@ async function init() {
156163
doRun(rootPath, file);
157164
break;
158165
case "init":
159-
doInit(rootPath, file);
166+
await doInit(rootPath, file);
160167
break;
161168
case "syncClient":
162169
await syncEntryInterface();

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.7.3",
3+
"version": "0.7.4",
44
"license": "Apache-2.0",
55
"exports": {
66
".": "./mod.ts",

0 commit comments

Comments
 (0)