mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
fix: docker cmd wrap
This commit is contained in:
@@ -239,7 +239,7 @@ enum DockerCmdType {
|
||||
}
|
||||
}
|
||||
|
||||
static final execAll = values.map((e) => e.exec).join(_cmdDivider);
|
||||
static final execAll = values.map((e) => e.exec).join(' && echo $seperator && ');
|
||||
}
|
||||
|
||||
enum BSDStatusCmdType {
|
||||
|
||||
@@ -64,7 +64,7 @@ class DockerProvider extends ChangeNotifier {
|
||||
final segments = raw.split(seperator);
|
||||
if (segments.length != DockerCmdType.values.length) {
|
||||
error = DockerErr(type: DockerErrType.segmentsNotMatch);
|
||||
Loggers.parse.warning('Docker segments: ${segments.length}');
|
||||
Loggers.parse.warning('Docker segments: ${segments.length}\n$raw');
|
||||
notifyListeners();
|
||||
return;
|
||||
}
|
||||
@@ -171,16 +171,14 @@ class DockerProvider extends ChangeNotifier {
|
||||
return null;
|
||||
}
|
||||
|
||||
// wrap cmd with `docker host & sudo`
|
||||
/// wrap cmd with `docker host`
|
||||
String _wrap(String cmd) {
|
||||
final dockerHost = Stores.docker.fetch(hostId!);
|
||||
if (dockerHost == null || dockerHost.isEmpty) {
|
||||
if (userName != 'root') {
|
||||
return 'sudo $cmd';
|
||||
}
|
||||
} else {
|
||||
final dockerHost = Stores.docker.fetch(hostId);
|
||||
cmd = 'export LANG=en_US.UTF-8 && $cmd';
|
||||
final noDockerHost = dockerHost?.isEmpty ?? true;
|
||||
if (!noDockerHost) {
|
||||
cmd = 'export DOCKER_HOST=$dockerHost && $cmd';
|
||||
}
|
||||
return 'export LANG=en_US.UTF-8 && $cmd';
|
||||
return cmd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 644;
|
||||
static const int build = 645;
|
||||
static const String engine = "3.16.0";
|
||||
static const String buildAt = "2023-11-20 11:49:47";
|
||||
static const int modifications = 4;
|
||||
static const int script = 26;
|
||||
static const String buildAt = "2023-11-20 16:47:25";
|
||||
static const int modifications = 5;
|
||||
static const int script = 27;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import '../../core/persistant_store.dart';
|
||||
class DockerStore extends PersistentStore<String> {
|
||||
DockerStore() : super('docker');
|
||||
|
||||
String? fetch(String id) {
|
||||
String? fetch(String? id) {
|
||||
return box.get(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user