saveLastClientId function

Future<void> saveLastClientId(
  1. String clientId
)

Saves the last used client ID to a file.

This function writes the provided clientId to the last_client.txt file located in the ./clonify/ directory. This allows the CLI to remember the last active client for convenience.

Note: This function is duplicated in clonify_core.dart. Consider refactoring.

Throws a FileSystemException if the file cannot be written.

Implementation

Future<void> saveLastClientId(String clientId) async {
  final file = File('./clonify/last_client.txt');
  await file.writeAsString(clientId);
}