mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
Revert "update to .env.local"
This reverts commit c6d8dbafde986db5d9cbbf216edb125f9b6056b0.
This commit is contained in:
parent
0f94f3f744
commit
091e90c9f1
33
bin/index.js
33
bin/index.js
@ -161,7 +161,7 @@ async function init() {
|
|||||||
{
|
{
|
||||||
type: 'password',
|
type: 'password',
|
||||||
name: 'seedPhrase',
|
name: 'seedPhrase',
|
||||||
message: 'Enter your Farcaster custody account seed phrase to generate a signed manifest for your frame\n(optional -- leave blank to create an unsigned frame)\n(seed phrase is only ever stored in .env.local)\n\nSeed phrase:',
|
message: 'Enter your Farcaster custody account seed phrase to generate a signed manifest for your frame\n(optional -- leave blank to create an unsigned frame)\n(seed phrase is only ever stored locally)\n\nSeed phrase:',
|
||||||
default: null
|
default: null
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
@ -301,12 +301,12 @@ async function init() {
|
|||||||
// Handle .env file
|
// Handle .env file
|
||||||
console.log('\nSetting up environment variables...');
|
console.log('\nSetting up environment variables...');
|
||||||
const envExamplePath = path.join(projectPath, '.env.example');
|
const envExamplePath = path.join(projectPath, '.env.example');
|
||||||
const envLocalPath = path.join(projectPath, '.env.local');
|
const envPath = path.join(projectPath, '.env');
|
||||||
if (fs.existsSync(envExamplePath)) {
|
if (fs.existsSync(envExamplePath)) {
|
||||||
// Read the example file content
|
// Read the example file content
|
||||||
const envExampleContent = fs.readFileSync(envExamplePath, 'utf8');
|
const envExampleContent = fs.readFileSync(envExamplePath, 'utf8');
|
||||||
// Write it to .env.local
|
// Write it to .env
|
||||||
fs.writeFileSync(envLocalPath, envExampleContent);
|
fs.writeFileSync(envPath, envExampleContent);
|
||||||
|
|
||||||
// Generate custody address from seed phrase
|
// Generate custody address from seed phrase
|
||||||
if (answers.seedPhrase) {
|
if (answers.seedPhrase) {
|
||||||
@ -318,32 +318,27 @@ async function init() {
|
|||||||
const neynarApiKey = answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO';
|
const neynarApiKey = answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO';
|
||||||
const fid = await lookupFidByCustodyAddress(custodyAddress, neynarApiKey);
|
const fid = await lookupFidByCustodyAddress(custodyAddress, neynarApiKey);
|
||||||
|
|
||||||
// Write seed phrase and FID to .env.local for manifest signature generation
|
// Write seed phrase and FID to .env for manifest signature generation
|
||||||
fs.appendFileSync(envLocalPath, `\nSEED_PHRASE="${answers.seedPhrase}"`);
|
fs.appendFileSync(envPath, `\nSEED_PHRASE="${answers.seedPhrase}"`);
|
||||||
fs.appendFileSync(envLocalPath, `\nFID="${fid}"`);
|
fs.appendFileSync(envPath, `\nFID="${fid}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (answers.splashImageUrl) {
|
if (answers.splashImageUrl) {
|
||||||
fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_SPLASH_IMAGE_URL="${answers.splashImageUrl}"`);
|
fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_SPLASH_IMAGE_URL="${answers.splashImageUrl}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (answers.iconImageUrl) {
|
if (answers.iconImageUrl) {
|
||||||
fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_ICON_IMAGE_URL="${answers.iconImageUrl}"`);
|
fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_ICON_IMAGE_URL="${answers.iconImageUrl}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append all remaining environment variables
|
// Append all remaining environment variables
|
||||||
fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_NAME="${answers.projectName}"`);
|
fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_NAME="${answers.projectName}"`);
|
||||||
fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_DESCRIPTION="${answers.description}"`);
|
fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_DESCRIPTION="${answers.description}"`);
|
||||||
fs.appendFileSync(envLocalPath, `\nNEXT_PUBLIC_FRAME_BUTTON_TEXT="${answers.buttonText}"`);
|
fs.appendFileSync(envPath, `\nNEXT_PUBLIC_FRAME_BUTTON_TEXT="${answers.buttonText}"`);
|
||||||
fs.appendFileSync(envLocalPath, `\nNEYNAR_API_KEY="${answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO'}"`);
|
fs.appendFileSync(envPath, `\nNEYNAR_API_KEY="${answers.useNeynar ? answers.neynarApiKey : 'FARCASTER_V2_FRAMES_DEMO'}"`);
|
||||||
|
|
||||||
fs.unlinkSync(envExamplePath);
|
fs.unlinkSync(envExamplePath);
|
||||||
console.log('\nCreated .env.local file from .env.example');
|
console.log('\nCreated .env file from .env.example');
|
||||||
|
|
||||||
// Add .env.local to .gitignore
|
|
||||||
const gitignorePath = path.join(projectPath, '.gitignore');
|
|
||||||
fs.appendFileSync(gitignorePath, '\n\n# Local environment variables\n.env.local\n.env.local.*');
|
|
||||||
console.log('Added .env.local to .gitignore');
|
|
||||||
} else {
|
} else {
|
||||||
console.log('\n.env.example does not exist, skipping copy and remove operations');
|
console.log('\n.env.example does not exist, skipping copy and remove operations');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user