shellQuote function

String shellQuote(
  1. String value
)

Implementation

String shellQuote(String value) {
  if (value.isEmpty) {
    return "''";
  }

  return "'${value.replaceAll("'", "'\"'\"'")}'";
}