Skip to content

Commit f19516e

Browse files
committed
refactor(container): Remove unused sudo and password parameters in exec method
Simplify the exec method signature by removing the sudo and password parameters that are no longer needed, as these functions are no longer in use
1 parent 0d80cd8 commit f19516e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/data/provider/container.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ enum ContainerCmdType {
380380
// and don't require splitting output with ScriptConstants.separator
381381
;
382382

383-
String exec(ContainerType type, {bool sudo = false, bool includeStats = false, String? password}) {
383+
String exec(ContainerType type, {bool includeStats = false}) {
384384
final baseCmd = switch (this) {
385385
ContainerCmdType.version => '${type.name} version $_jsonFmt',
386386
ContainerCmdType.ps => switch (type) {
@@ -398,18 +398,12 @@ enum ContainerCmdType {
398398
ContainerCmdType.images => '${type.name} image ls $_jsonFmt',
399399
};
400400

401-
if (sudo && password != null) {
402-
return _buildSudoCmd(baseCmd, password);
403-
}
404-
if (sudo) {
405-
return 'sudo -S $baseCmd';
406-
}
407401
return baseCmd;
408402
}
409403

410404
static String execAll(ContainerType type, {bool sudo = false, bool includeStats = false, String? password}) {
411405
final commands = ContainerCmdType.values
412-
.map((e) => e.exec(type, sudo: false, includeStats: includeStats))
406+
.map((e) => e.exec(type, includeStats: includeStats))
413407
.join('\necho ${ScriptConstants.separator}\n');
414408

415409
final needsShWrapper = commands.contains('\n') || commands.contains('echo ${ScriptConstants.separator}');

0 commit comments

Comments
 (0)