createFile method

  1. @override
Future<void> createFile(
  1. String absPath
)
override

Creates an empty file at absPath (with parent directories).

Implementation

@override
Future<void> createFile(String absPath) async {
  final r = await _run(
    'mkdir -p -- "\$(dirname -- ${_q(absPath)})" && touch -- ${_q(absPath)}',
  );
  if (r.exitCode != 0) {
    throw WorkspaceException(
      'cannot create $absPath: ${r.stderrText.trim()}',
    );
  }
}