Skip to content

Commit

Permalink
modifying index.js file
Browse files Browse the repository at this point in the history
  • Loading branch information
glo80684 committed Dec 6, 2024
1 parent e7b42ad commit 0204d86
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/create-pwa/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ const defaultSampleBackends = require('@magento/pwa-buildpack/sampleBackends.jso

const uniqBy = (array, property) => {
const map = new Map();

for (const element of array) {
if (element && element.hasOwnProperty(property)) {
map.set(element[property], element);
}
}

return Array.from(map.values());
};

Expand All @@ -32,7 +30,6 @@ const fetchSampleBackends = async () => {
'https://fvp0esmt8f.execute-api.us-east-1.amazonaws.com/default/getSampleBackends'
);
const { sampleBackends } = await res.json();

return sampleBackends.environments;
} catch {
return [];
Expand Down Expand Up @@ -129,14 +126,7 @@ module.exports = async () => {
default: 'https://magento2.localhost',
when: ({ backendUrl }) => !backendUrl
},
{
name: 'backendEdition',
type: 'list',
message:
'Edition of the magento store (Adobe Commerce or Magento Open Source)',
choices: ['AC', 'EE', 'MOS', 'CE'],
default: 'AC'
},
// Removed the question for backendEdition and set it directly
{
name: 'braintreeToken',
message:
Expand All @@ -163,6 +153,7 @@ module.exports = async () => {
answers = await inquirer.prompt(questions);

answers.backendUrl = answers.backendUrl || answers.customBackendUrl;

const args = questions.reduce(
(args, q) => {
if (q.name === 'customBackendUrl' || q.name === 'directory') {
Expand All @@ -184,6 +175,9 @@ module.exports = async () => {
['create-project', answers.directory]
);

// Set backendEdition directly without asking
args.push('--backend-edition', `"AC"`);

const argsString = args.join(' ');

console.log(
Expand Down

0 comments on commit 0204d86

Please sign in to comment.