@@ -19,6 +19,7 @@ import {
1919} from "@deno/framework-detect" ;
2020
2121import { publish } from "../publish.ts" ;
22+ import { resolve } from "@std/path" ;
2223
2324export 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