Add prettier
This commit is contained in:
@ -6,13 +6,13 @@
|
||||
* You can remove the `reset-project` script from package.json and safely delete this file after running it.
|
||||
*/
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const root = process.cwd();
|
||||
const oldDirs = ["app", "components", "hooks", "constants", "scripts"];
|
||||
const newDir = "app-example";
|
||||
const newAppDir = "app";
|
||||
const oldDirs = ['app', 'components', 'hooks', 'constants', 'scripts'];
|
||||
const newDir = 'app-example';
|
||||
const newAppDir = 'app';
|
||||
const newDirPath = path.join(root, newDir);
|
||||
|
||||
const indexContent = `import { Text, View } from "react-native";
|
||||
@ -60,21 +60,21 @@ const moveDirectories = async () => {
|
||||
// Create new /app directory
|
||||
const newAppDirPath = path.join(root, newAppDir);
|
||||
await fs.promises.mkdir(newAppDirPath, { recursive: true });
|
||||
console.log("\n📁 New /app directory created.");
|
||||
console.log('\n📁 New /app directory created.');
|
||||
|
||||
// Create index.tsx
|
||||
const indexPath = path.join(newAppDirPath, "index.tsx");
|
||||
const indexPath = path.join(newAppDirPath, 'index.tsx');
|
||||
await fs.promises.writeFile(indexPath, indexContent);
|
||||
console.log("📄 app/index.tsx created.");
|
||||
console.log('📄 app/index.tsx created.');
|
||||
|
||||
// Create _layout.tsx
|
||||
const layoutPath = path.join(newAppDirPath, "_layout.tsx");
|
||||
const layoutPath = path.join(newAppDirPath, '_layout.tsx');
|
||||
await fs.promises.writeFile(layoutPath, layoutContent);
|
||||
console.log("📄 app/_layout.tsx created.");
|
||||
console.log('📄 app/_layout.tsx created.');
|
||||
|
||||
console.log("\n✅ Project reset complete. Next steps:");
|
||||
console.log('\n✅ Project reset complete. Next steps:');
|
||||
console.log(
|
||||
"1. Run `npx expo start` to start a development server.\n2. Edit app/index.tsx to edit the main screen.\n3. Delete the /app-example directory when you're done referencing it."
|
||||
"1. Run `npx expo start` to start a development server.\n2. Edit app/index.tsx to edit the main screen.\n3. Delete the /app-example directory when you're done referencing it.",
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(`Error during script execution: ${error}`);
|
||||
|
Reference in New Issue
Block a user