utils/clonify_helpers library

Properties

clonifySettings ClonifySettings
final
logger → Logger
final

Functions

confirmTUI(String message, {bool defaultValue = false, bool? skip}) bool
TUI-enhanced confirmation prompt.
getAppBundleId(String clientId) Future<String>
Retrieves the application bundle ID (package name) for a given client ID.
getArgumentValue(List<String> args, String key) String?
Retrieves the value associated with a specific command-line argument key.
getArgValue(List<String> args, String key) String
Retrieves the value associated with a specific command-line argument key.
getLastClientId([String lastClientFilePath = './clonify/last_client.txt']) Future<String?>
Retrieves the last used client ID from a file.
getLastConfig() Future<Map<String, dynamic>?>
Retrieves the last saved configuration map from a JSON file.
getVersionFromConfig(String clientId) Future<String>
Retrieves the version number from a client's configuration file.
newLineArrow([int tabs = 3]) String
Generates a formatted string with a newline, indentation, and an arrow symbol.
printUsage() → void
Prints the usage information and available commands for the Clonify CLI tool.
prompt(String message, {String? skipValue, bool? skip}) String
Displays a message to the user and waits for their input.
promptUser(String promptMessage, String defaultValue, {bool validator(String)?, bool? skip, String? skipValue}) String
Prompts the user for input with a default value and optional validation.
promptUserTUI(String promptMessage, String defaultValue, {bool validator(String)?, bool? skip, String? skipValue}) String
TUI-enhanced version of promptUser with better interactive experience.
runCommand(String command, List<String> args, {String? successMessage, bool showLoading = true, String? loadingMessage, String? workingDirectory}) Future<void>
Executes a shell command with optional loading indicators and error handling.
sanitizeArg(String arg) String
Sanitizes a command-line argument to prevent command injection vulnerabilities.
saveLastClientId(String clientId) Future<void>
Saves the last used client ID to a file.
selectManyTUI(String message, List<String> choices, {List<String>? defaultValues}) List<String>
TUI-enhanced multi-choice selection.
selectOneTUI(String message, List<String> choices, {String? defaultValue}) String?
TUI-enhanced single-choice selection.
toTitleCase(String text) String
Converts the first character of a given string to uppercase.
versionNumberIncrementor(String version) String
Increments the patch version and build number of a semantic version string.