createIgnoreFile method
void
createIgnoreFile({
- dynamic onAlreadyExists()? = onIgnoreFileAlreadyExists,
- dynamic onSuccessfullyCreated()? = onIgnoreFileSuccessfullyCreated,
- dynamic onRepositoryNotInitialized()? = onRepositoryNotInitialized,
Creates an ignoreFile
Implementation
void createIgnoreFile({
Function()? onAlreadyExists = onIgnoreFileAlreadyExists,
Function()? onSuccessfullyCreated = onIgnoreFileSuccessfullyCreated,
Function()? onRepositoryNotInitialized = onRepositoryNotInitialized,
}) {
if (!repository.isInitialized) {
debugPrintToConsole(
message: "Repository not initialized",
);
onRepositoryNotInitialized?.call();
return;
}
if (ignoreFile.existsSync()) {
onAlreadyExists?.call();
return;
}
ignoreFile.createSync(recursive: true, exclusive: true);
onSuccessfullyCreated?.call();
}