Skip to content

Commit 83e62ca

Browse files
unisol1020mrzachnugent
authored andcommitted
remove unused import path update function from init command
1 parent 77dec78 commit 83e62ca

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

apps/cli/src/commands/init.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -206,32 +206,6 @@ async function updateLayoutFile(cwd: string, spinner: Ora) {
206206
}
207207
}
208208

209-
async function updateImportPaths(cwd: string, spinner: Ora) {
210-
try {
211-
spinner.text = 'Updating import paths...';
212-
const files = await glob(['**/*.{ts,tsx,js,jsx}'], {
213-
cwd,
214-
ignore: ['node_modules/**', 'dist/**', 'build/**', '.expo/**'],
215-
});
216-
217-
for (const file of files) {
218-
const filePath = path.join(cwd, file);
219-
const content = await fs.readFile(filePath, 'utf8');
220-
const updatedContent = content
221-
.replace(/(from\s+['"])@\/(.*?['"])/g, '$1~/$2')
222-
.replace(/(import\s+['"])@\/(.*?['"])/g, '$1~/$2');
223-
224-
if (content !== updatedContent) {
225-
await fs.writeFile(filePath, updatedContent);
226-
spinner.text = `Updated imports in ${file}`;
227-
}
228-
}
229-
} catch (error) {
230-
spinner.fail('Failed to update import paths');
231-
handleError(error);
232-
}
233-
}
234-
235209
async function shouldPromptGitWarning(cwd: string): Promise<boolean> {
236210
try {
237211
execSync('git rev-parse --is-inside-work-tree', { cwd });
@@ -292,7 +266,6 @@ async function initializeProject(cwd: string, overwrite: boolean) {
292266
await copyTemplateFile(file, templatesDir, cwd, spinner, overwrite);
293267
}
294268

295-
await updateImportPaths(cwd, spinner);
296269
await updateLayoutFile(cwd, spinner);
297270

298271
spinner.succeed('Initialization completed successfully!');

0 commit comments

Comments
 (0)