Skip to content

Commit 05f4912

Browse files
committed
chore: remove print
1 parent f9e936f commit 05f4912

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

bin/script_runner.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ Future<void> main(List<String> args) async {
66
final scriptCmd = args.first;
77
final scriptArgs = args.sublist(1);
88
try {
9-
print('Running script: $scriptCmd $scriptArgs');
109
await runScript(scriptCmd, scriptArgs);
1110
} catch (e) {
1211
printColor('$e', [TerminalColor.red]);
1312
}
1413
}
15-

lib/src/runnable_script.dart

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,21 @@ class RunnableScript {
6565
}) : _fileSystem = fileSystem ?? LocalFileSystem();
6666

6767
/// Generate a runnable script from a yaml loaded map as defined in the config.
68-
factory RunnableScript.fromYamlMap(yaml.YamlMap map,
69-
{FileSystem? fileSystem}) {
68+
factory RunnableScript.fromYamlMap(yaml.YamlMap map, {FileSystem? fileSystem}) {
7069
final out = <String, dynamic>{};
7170

7271
if (map['name'] == null && map.keys.length == 1) {
7372
out['name'] = map.keys.first;
7473
out['cmd'] = map.values.first;
7574
} else {
7675
out.addAll(map.cast<String, dynamic>());
77-
out['args'] =
78-
(map['args'] as yaml.YamlList?)?.map((e) => e.toString()).toList();
76+
out['args'] = (map['args'] as yaml.YamlList?)?.map((e) => e.toString()).toList();
7977
out['env'] = (map['env'] as yaml.YamlMap?)?.cast<String, String>();
8078
}
8179
try {
8280
return RunnableScript.fromMap(out, fileSystem: fileSystem);
8381
} catch (e) {
84-
throw StateError(
85-
'Failed to parse script, arguments: $map, $fileSystem. Error: $e');
82+
throw StateError('Failed to parse script, arguments: $map, $fileSystem. Error: $e');
8683
}
8784
}
8885

@@ -112,8 +109,7 @@ class RunnableScript {
112109
appendNewline: appendNewline,
113110
);
114111
} catch (e) {
115-
throw StateError(
116-
'Failed to parse script, arguments: $map, $fileSystem. Error: $e');
112+
throw StateError('Failed to parse script, arguments: $map, $fileSystem. Error: $e');
117113
}
118114
}
119115

@@ -175,8 +171,7 @@ class RunnableScript {
175171
return exitCode;
176172
}
177173

178-
String _getScriptPath() => _fileSystem.path
179-
.join(_fileSystem.systemTempDirectory.path, 'script_runner_$name.sh');
174+
String _getScriptPath() => _fileSystem.path.join(_fileSystem.systemTempDirectory.path, 'script_runner_$name.sh');
180175

181176
String _getScriptContents(
182177
ScriptRunnerConfig config, {
@@ -192,12 +187,8 @@ class RunnableScript {
192187
].join('\n');
193188
case OS.linux:
194189
case OS.macos:
195-
return [
196-
...preloadScripts.map((e) =>
197-
"[[ ! \$(which ${e.name}) ]] && alias ${e.name}='scr ${e.name}'"),
198-
script
199-
].join('\n');
190+
return [...preloadScripts.map((e) => "[[ ! \$(which ${e.name}) ]] && alias ${e.name}='scr ${e.name}'"), script]
191+
.join('\n');
200192
}
201193
}
202194
}
203-

lib/src/utils.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,3 @@ class TerminalColor {
134134
static const TerminalColor bold = TerminalColor._(1);
135135
static const TerminalColor underline = TerminalColor._(4);
136136
}
137-

0 commit comments

Comments
 (0)