feat: custom shell script install path (#545)

This commit is contained in:
lollipopkit🏳️‍⚧️
2024-08-17 22:44:35 +08:00
committed by GitHub
parent d7ae8b75b8
commit 76e98c6468
20 changed files with 199 additions and 124 deletions

View File

@@ -26,7 +26,7 @@ enum NetViewType {
NetViewType.speed => l10n.speed,
};
/// If no device is specified, return the cached value (only real devices,
/// If no device is specified, return the cached value (only real devices,
/// such as ethX, wlanX...).
(String, String) build(ServerStatus ss, {String? dev}) {
final notSepcifyDev = dev == null || dev.isEmpty;

View File

@@ -1,4 +1,5 @@
import 'package:server_box/core/extension/context/locale.dart';
import 'package:server_box/data/provider/server.dart';
import 'package:server_box/data/res/build_data.dart';
import 'package:server_box/data/model/server/system.dart';
@@ -29,6 +30,9 @@ enum ShellFunc {
/// Default is [scriptDirTmp]/[scriptFile], if this path is not accessible,
/// it will be changed to [scriptDirHome]/[scriptFile].
static String getScriptDir(String id) {
final customScriptDir =
ServerProvider.pick(id: id)?.value.spi.custom?.scriptDir;
if (customScriptDir != null) return customScriptDir;
return _scriptDirMap.putIfAbsent(id, () {
return scriptDirTmp;
});

View File

@@ -3,6 +3,6 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 1068;
static const int build = 1069;
static const int script = 57;
}