mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix & opt.
- fix: `sftpGoPath` - opt.: `PersistentStore.toJson` - rm: `first` store - opt.: log print
This commit is contained in:
@@ -60,11 +60,11 @@ class Backup {
|
||||
spis = Stores.server.fetch(),
|
||||
snippets = Stores.snippet.fetch(),
|
||||
keys = Stores.key.fetch(),
|
||||
dockerHosts = Stores.docker.fetchAll(),
|
||||
dockerHosts = Stores.docker.toJson(),
|
||||
settings = Stores.setting.toJson();
|
||||
|
||||
static Future<String> backup() async {
|
||||
final result = _diyEncrtpt(json.encode(Backup.loadFromStore()));
|
||||
final result = _diyEncrypt(json.encode(Backup.loadFromStore()));
|
||||
final path = await Paths.bak;
|
||||
await File(path).writeAsString(result);
|
||||
return path;
|
||||
@@ -95,7 +95,7 @@ class Backup {
|
||||
: this.fromJson(json.decode(_diyDecrypt(raw)));
|
||||
}
|
||||
|
||||
String _diyEncrtpt(String raw) => json.encode(
|
||||
String _diyEncrypt(String raw) => json.encode(
|
||||
raw.codeUnits.map((e) => e * 2 + 1).toList(growable: false),
|
||||
);
|
||||
|
||||
|
||||
@@ -68,7 +68,9 @@ enum PkgManager {
|
||||
list.removeWhere((element) => element.isEmpty);
|
||||
final endLine = list.lastIndexWhere(
|
||||
(element) => element.contains('Obsoleting Packages'));
|
||||
list = list.sublist(0, endLine);
|
||||
if (endLine != -1 && list.isNotEmpty) {
|
||||
list = list.sublist(0, endLine);
|
||||
}
|
||||
break;
|
||||
case PkgManager.apt:
|
||||
// avoid other outputs
|
||||
|
||||
Reference in New Issue
Block a user