Skip to content

Commit f0ddf65

Browse files
committed
fixes
1 parent 07785ae commit f0ddf65

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

deploy/create/mod.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from "@deno/framework-detect";
2020

2121
import { publish } from "../publish.ts";
22+
import { resolve } from "@std/path";
2223

2324
export const createCommand = new Command<GlobalContext>()
2425
.description(
@@ -217,19 +218,30 @@ export const createCommand = new Command<GlobalContext>()
217218
);
218219
}
219220

220-
const member = appDirectories.members.find((member) =>
221-
member.path === options.appDirectory
222-
);
221+
const member = appDirectories.members.find((member) => {
222+
if (source === "local") {
223+
return resolve(rootPath, member.path) ===
224+
resolve(rootPath, options.appDirectory || "");
225+
} else {
226+
return member.path === options.appDirectory || "";
227+
}
228+
});
229+
230+
let buildDirectory;
223231

224-
const buildDirectory = member?.path ??
225-
require(options.appDirectory, "app-directory");
232+
if (source === "github") {
233+
buildDirectory = member?.path ??
234+
require(options.appDirectory, "app-directory");
235+
} else {
236+
buildDirectory = undefined;
237+
}
226238

227239
let buildConfig;
228240
if (options.useDetectedBuildConfig) {
229241
if (member?.buildConfig) {
230242
buildConfig = member?.buildConfig;
231243
} else {
232-
throw new ValidationError(
244+
throw new TypeError(
233245
`No build configuration was detected in '${buildDirectory}'.`,
234246
);
235247
}

0 commit comments

Comments
 (0)