cloneAndSetupProject static method
Clone repository from GitHub and create folder and setup main packages. and other main feature
Implementation
static Future cloneAndSetupProject(
{required AppDataModel appInfo, required String dirName}) async {
print("\n\nšš Thunder will initialize your app. Please wait for seconds");
final ProcessResult processResult =
await CloneRepoAndSetupProject._cloneRepo(
repoUrl: appInfo.stateManagement.getRepoUrl(),
dirName: dirName,
);
if (processResult.exitCode == 0) {
bool setupResult =
await CloneRepoAndSetupProject._setupClonedProject(appInfo);
if (setupResult) {
print('ā” Init app successfully š\n');
await PublishProjectToGithub.publishProjectToGithub();
await OpenProjectInVSCode.openProjectInVSCode();
} else {
print('š
An error occurred during project setup.');
}
} else {
print(
'š
Failed to clone the repository.\n Exit code : ${processResult.exitCode}\n Error : ${processResult.stderr}');
}
}