StringExtension extension

String extensions for command execution and file operations.

This module extends the String class with useful utilities for command-line operations, process execution, and file manipulation.

Example usage:

// Execute a command and wait for completion
await 'dart --version'.run;

// Start a process with custom options
await 'flutter build apk'.start(
  workingDirectory: '/path/to/project',
  showLog: false,
);

// Write to a file
'/path/to/file.txt'.write('Hello World');

// Append to a file
'/path/to/log.txt'.append('New log entry');

String extensions for enhanced command-line and file operations.

on

Properties

run Future<int>

Available on String, provided by the StringExtension extension

no setter

Methods

append(String line) → void

Available on String, provided by the StringExtension extension

start({String? workingDirectory, void progressOut(String line)?, void progressErr(String line)?, bool showLog = true}) Future<int>

Available on String, provided by the StringExtension extension

startWithStdin({String? workingDirectory, void progressOut(String line)?, void progressErr(String line)?, bool showLog = true, bool singleCharacterMode = false}) Future<int>

Available on String, provided by the StringExtension extension

Starts a process with stdin forwarding for interactive commands.
write(String line) → void

Available on String, provided by the StringExtension extension