Skip to content

Commit

Permalink
[process_run] v0.13.2 export stringToArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Oct 22, 2023
1 parent 1f45eb8 commit 2a5ede8
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_ci_downgrade_analyze.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run CI
name: Run CI Downgrade analyze
on:
push:
pull_request:
Expand All @@ -25,4 +25,4 @@ jobs:
sdk: ${{ matrix.dart }}
- run: dart --version
- run: dart pub global activate dev_test
- run: dart pub global run dev_test:run_ci --pub-downgrade --analyze --no-override --recursive
- run: dart pub global run dev_test:run_ci --pub-downgrade --analyze --no-override --recursive
4 changes: 4 additions & 0 deletions packages/process_run/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.13.2

* Export `stringToArguments` in `shell.dart`

## 0.13.1

* Dart 3 only
Expand Down
2 changes: 2 additions & 0 deletions packages/process_run/lib/process_run.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
///
/// Helper to run a process and connect the input/output for verbosity
///
library;

export 'package:process_run/src/shell_utils_common.dart'
show argumentsToString, argumentToString;

Expand Down
2 changes: 1 addition & 1 deletion packages/process_run/lib/shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export 'package:process_run/src/shell_utils.dart'
shellArguments,
shellExecutableArguments;
export 'package:process_run/src/shell_utils_common.dart'
show argumentsToString, argumentToString;
show argumentsToString, argumentToString, stringToArguments;
export 'package:process_run/src/user_config.dart'
show userPaths, userEnvironment, userLoadEnvFile, userLoadEnv;

Expand Down
2 changes: 2 additions & 0 deletions packages/process_run/lib/shell_run.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/// Deprecated in 1.0.0. Prefer using shell in the future
library;

export 'shell.dart';
3 changes: 1 addition & 2 deletions packages/process_run/lib/src/bin/shell/env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import 'env_var.dart';
import 'import.dart';

class ShellEnvCommandBase extends ShellBinCommand {
ShellEnvCommandBase({required String name, String? description})
: super(name: name, description: description) {
ShellEnvCommandBase({required super.name, super.description}) {
parser.addFlag(flagLocal,
abbr: 'l', help: 'Use local env', negatable: false, defaultsTo: true);
parser.addFlag(flagUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class FileContent {
}

class EnvFileContent extends FileContent {
EnvFileContent(String path) : super(path);
EnvFileContent(super.path);

bool addAlias(String alias, String command) =>
writeKeyValue(userConfigAliasKeys, alias, value: command);
Expand Down
1 change: 1 addition & 0 deletions packages/process_run/lib/src/common/dev_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// Development helpers to generate warning in code
library;

void _devPrint(Object object) {
if (_devPrintEnabled) {
Expand Down
5 changes: 2 additions & 3 deletions packages/process_run/lib/src/shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,8 @@ abstract class Shell implements ShellCore {
class _ProcessCmd extends ProcessCmd {
final String executableShortName;

_ProcessCmd(String executable, List<String> arguments,
{required this.executableShortName})
: super(executable, arguments);
_ProcessCmd(String super.executable, super.arguments,
{required this.executableShortName});

@override
String toString() =>
Expand Down
5 changes: 2 additions & 3 deletions packages/process_run/lib/src/shell_environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class ShellEnvironment extends common.ShellEnvironmentBase {
/// It is recommended that you apply the environment to a shell. But it can
/// also be set globally (be aware of the potential effect on other part of
/// your application) to [shellEnvironment]
ShellEnvironment({Map<String, String>? environment})
: super.fromEnvironment(environment: environment);
ShellEnvironment({super.environment}) : super.fromEnvironment();

/// From a run start content, includeParentEnvironment should later be set
/// to false
Expand Down Expand Up @@ -50,7 +49,7 @@ class ShellEnvironment extends common.ShellEnvironmentBase {
///
/// Mainly used for testing as it is not easy to which environment variable
/// are required.
ShellEnvironment.fromJson(Map? map) : super.fromJson(map);
ShellEnvironment.fromJson(super.map) : super.fromJson();

/// Find a [command] path location in the environment
String? whichSync(String command) {
Expand Down
5 changes: 5 additions & 0 deletions packages/process_run/lib/src/shell_utils_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:convert';
import 'package:process_run/src/platform/platform.dart';

import 'characters.dart';
import 'shell_utils.dart' as shell_utils;

const windowsDefaultPathExt = <String>['.exe', '.bat', '.cmd', '.com'];

Expand Down Expand Up @@ -86,3 +87,7 @@ String shellArgument(String argument) => argumentToString(argument);

/// Convert multiple arguments to string than can be used in a terminal
String shellArguments(List<String> arguments) => argumentsToString(arguments);

/// Convert a string command to arguments.
List<String> stringToArguments(String command) =>
shell_utils.shellSplit(command);
2 changes: 1 addition & 1 deletion packages/process_run/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: process_run
version: 0.13.1
version: 0.13.2
description: Process run helpers for Linux/Win/Mac and which like feature for finding executables.
homepage: https://github.com/tekartik/process_run.dart/blob/master/packages/process_run

Expand Down
3 changes: 3 additions & 0 deletions packages/process_run/test/shell_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ void main() {
ProcessCmd;
processResultToDebugString;
processCmdToDebugString;

// shell_utils
stringToArguments;
});
});
}

0 comments on commit 2a5ede8

Please sign in to comment.