addLiveCommandsToProvider function

String? addLiveCommandsToProvider(
  1. String source
)

Returns source with liveCommands: liveCommands added as the last argument of its first nylo.configure(...) call and liveCommandsImport added after the last import.

Returns source unchanged when it already mentions liveCommands, and null when it has no nylo.configure(...) call.

Implementation

String? addLiveCommandsToProvider(String source) {
  if (_passesLiveCommands(source)) return source;
  return _addConfigureArgument(
    source,
    argument: 'liveCommands: liveCommands',
    import: liveCommandsImport,
  );
}