Skip to content

Commit

Permalink
[process_run] v1.2.0+3 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Sep 30, 2024
1 parent e1bde3c commit 2437100
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/process_run/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.2.0+2
## 1.2.0+3

* Export ShellBinCommand
* requires dart 3.5
Expand Down
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.0+2
version: 1.2.0+3
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
17 changes: 0 additions & 17 deletions packages/process_run/test/build_runner_test.dart

This file was deleted.

14 changes: 14 additions & 0 deletions packages/process_run/test/src/compile_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'dart:io';

import 'package:path/path.dart';
import 'package:process_run/shell.dart';
import 'package:process_run/src/bin/shell/shell.dart';
import 'package:pub_semver/pub_semver.dart';

/// Return the executable path.
Future<String> compileShellBin({bool force = false}) async {
Expand All @@ -11,6 +13,18 @@ Future<String> compileShellBin({bool force = false}) async {
var dsExePath = join('build', folder, 'ds$exeExtension');
var dsExeDir = dirname(dsExePath);
var shell = Shell(verbose: false);
if (File(dsExePath).existsSync()) {
try {
var output = (await shell.run('$dsExePath --version')).outText.trim();
if (Version.parse(output) != shellBinVersion) {
force = true;
}
} catch (_) {
// ignore
force = true;
}
}

if (!File(dsExePath).existsSync() || force) {
Directory(dsExeDir).createSync(recursive: true);
await shell.run(
Expand Down

0 comments on commit 2437100

Please sign in to comment.