Skip to content

Commit

Permalink
[process_run] v1.2.1+1 fix user flag handling in ds executable
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Oct 22, 2024
1 parent 957f6d9 commit af38dc6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/process_run/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.2.1
## 1.2.1+1

* Add `ShellLinesController.binaryStream` to allow processing binary data and allow using it for stdin.
* Fix `--user` flag handling in `ds` executable.

## 1.2.0+3

Expand Down
21 changes: 12 additions & 9 deletions packages/process_run/lib/src/bin/shell/env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ class ShellEnvCommandBase extends ShellBinCommand {
abbr: 'u', help: 'Use user env instead of local env', negatable: false);
}

/// Local env
/// Local env (default)
bool get local {
if (!results.wasParsed(flagUser)) {
var parent = this.parent;
if (parent is ShellEnvCommandBase) {
return parent.local;
}
if (results.wasParsed(flagUser)) {
final user = results.flag(flagUser);
return !user;
}
if (results.wasParsed(flagLocal)) {
return results.flag(flagLocal);
}
var parent = this.parent;
if (parent is ShellEnvCommandBase) {
return parent.local;
}
final user = results.flag(flagUser);
final local = !user;
return local;
return true;
}

/// Local/User label
Expand Down
3 changes: 2 additions & 1 deletion packages/process_run/lib/src/bin/shell/env_var.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:process_run/src/bin/shell/env.dart';
import 'package:process_run/src/bin/shell/env_var_delete.dart';
import 'package:process_run/src/bin/shell/env_var_dump.dart';

Expand All @@ -6,7 +7,7 @@ import 'env_var_set.dart';
import 'import.dart';

/// Shell env var command.
class ShellEnvVarCommand extends ShellBinCommand {
class ShellEnvVarCommand extends ShellEnvCommandBase {
/// Shell env var command.
ShellEnvVarCommand()
: super(
Expand Down
2 changes: 1 addition & 1 deletion packages/process_run/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:pub_semver/pub_semver.dart';

/// Package version text
const packageVersionText = '1.2.1';
const packageVersionText = '1.2.1+1';

/// Package version
final packageVersion = Version.parse(packageVersionText);
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: 1.2.1
version: 1.2.1+1
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

0 comments on commit af38dc6

Please sign in to comment.