daily_programmer_client_dart 1.1.2 daily_programmer_client_dart: ^1.1.2 copied to clipboard
Daily programing dart. `daily_programmer_dart_cli` will generate a project skeleton into the current directory.
import 'dart:io';
const _nameOfProject = 'project-example';
// This dart code send 4 command in your shell for example.
void main(List<String> args) {
setUpExample();
// Step 1: project command dry run
run('daily_programmer_dart_cli project --dry-run -p /tmp -n challenge-0 $_nameOfProject');
// Step 2: project command
run('daily_programmer_dart_cli project -p /tmp -n challenge-0 project');
// Step 3: challenge command dry run
run('daily_programmer_dart_cli challenge --dry-run -p /tmp/$_nameOfProject challenge-1');
// Step 4: challenge command
run('daily_programmer_dart_cli challenge -p /tmp/$_nameOfProject challenge-1');
}
/// Simple process runner wrapper
void run(String command) {
Process.runSync(command.split(' ')[0], command.split(' ')..removeAt(0));
}
/// Check OS and remove `/tmp/project` for clean this example
void setUpExample() {
if (!Platform.isLinux && !Platform.isMacOS) {
print('Your OS (${Platform.operatingSystem}) is not supported.');
exit(1);
}
run('rm -rf /tmp/$_nameOfProject');
}