Skip to content

Commit

Permalink
Merge pull request #8 from BWsix/patch-1
Browse files Browse the repository at this point in the history
Fix: generate `.env.local` instead of `.env` for next.js projects
  • Loading branch information
so99ynoodles authored May 16, 2022
2 parents 89952ea + edf72d4 commit 95c282f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion create-liff-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const envPrefix: Record<string, string> = {
nuxtjs: '',
'nuxtjs-ts': ''
};
const envFileNameVariant: Record<string, string> = {
nextjs: '.env.local',
'nextjs-ts': '.env.local',
};
const rename: Record<string, string> = {
'.gitignore.default': '.gitignore'
};
Expand Down Expand Up @@ -93,7 +97,8 @@ export async function createLiffApp(answers: Answers) {

// create .env file
const content = `${envPrefix[templateName]}LIFF_ID=${liffId}`;
fs.writeFileSync(path.join(root, '.env'), content);
const envFileName = envFileNameVariant[templateName] || '.env';
fs.writeFileSync(path.join(root, envFileName), content);

// install
const isYarn = packageManager === 'yarn';
Expand Down

0 comments on commit 95c282f

Please sign in to comment.