Skip to content

Commit

Permalink
Merge pull request #4768 from Shopify/fix-init-with-custom-tempaltes
Browse files Browse the repository at this point in the history
Fix `app init` with custom templates.
  • Loading branch information
isaacroldan authored Oct 31, 2024
2 parents fae0225 + 5fa2617 commit 4a1b164
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/app/src/cli/services/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {OrganizationApp} from '../../models/organization.js'
import {DeveloperPlatformClient} from '../../utilities/developer-platform-client.js'
import {loadApp} from '../../models/app/loader.js'
import {SelectAppOrNewAppNameResult} from '../../commands/app/init.js'
import {loadLocalExtensionsSpecifications} from '../../models/extensions/load-specifications.js'
import {
findUpAndReadPackageJson,
lockfiles,
Expand Down Expand Up @@ -197,8 +198,10 @@ async function init(options: InitOptions) {

let app: OrganizationApp
if (options.selectedAppOrNameResult.result === 'new') {
// Load the local app to get the creation options. No need for specs since we only care about Creation Options.
const localApp = await loadApp({specifications: [], directory: outputDirectory, userProvidedConfigName: undefined})
// Load the local app to get the creation options.
// NOTE: need the specs to load the scopes, if we ever remove the local specs, we need to find a way to do this without them.
const specifications = await loadLocalExtensionsSpecifications()
const localApp = await loadApp({specifications, directory: outputDirectory, userProvidedConfigName: undefined})
const org = options.selectedAppOrNameResult.org
app = await options.developerPlatformClient.createApp(org, options.name, localApp.creationDefaultOptions())
} else {
Expand Down

0 comments on commit 4a1b164

Please sign in to comment.