mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: condig dir perm (#299)
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
import 'package:toolbox/core/extension/context/locale.dart';
|
|
||||||
import 'package:toolbox/data/model/app/shell_func.dart';
|
|
||||||
|
|
||||||
extension StatusCmdTypeX on StatusCmdType {
|
|
||||||
String get i18n => switch (this) {
|
|
||||||
StatusCmdType.sys => l10n.system,
|
|
||||||
StatusCmdType.host => l10n.host,
|
|
||||||
StatusCmdType.uptime => l10n.uptime,
|
|
||||||
StatusCmdType.battery => l10n.battery,
|
|
||||||
final val => val.name,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:toolbox/core/extension/context/locale.dart';
|
||||||
|
|
||||||
import '../../res/build_data.dart';
|
import '../../res/build_data.dart';
|
||||||
import '../server/system.dart';
|
import '../server/system.dart';
|
||||||
|
|
||||||
@@ -30,9 +32,9 @@ enum ShellFunc {
|
|||||||
static const srvBoxDir = '$_homeVar/$_srvBoxDir';
|
static const srvBoxDir = '$_homeVar/$_srvBoxDir';
|
||||||
static const _installShellPath = '$_homeVar/$_srvBoxDir/$_scriptFile';
|
static const _installShellPath = '$_homeVar/$_srvBoxDir/$_scriptFile';
|
||||||
|
|
||||||
/// Issue #168
|
// Issue #299, chmod ~/.config to avoid permission issue
|
||||||
/// Use `sh` for compatibility
|
|
||||||
static const installShellCmd = """
|
static const installShellCmd = """
|
||||||
|
chmod +x ~/.config &> /dev/null
|
||||||
mkdir -p $_homeVar/$_srvBoxDir
|
mkdir -p $_homeVar/$_srvBoxDir
|
||||||
cat > $_installShellPath
|
cat > $_installShellPath
|
||||||
chmod +x $_installShellPath
|
chmod +x $_installShellPath
|
||||||
@@ -63,7 +65,6 @@ chmod +x $_installShellPath
|
|||||||
return 'status';
|
return 'status';
|
||||||
// case ShellFunc.docker:
|
// case ShellFunc.docker:
|
||||||
// // `dockeR` -> avoid conflict with `docker` command
|
// // `dockeR` -> avoid conflict with `docker` command
|
||||||
// // 以防止循环递归
|
|
||||||
// return 'dockeR';
|
// return 'dockeR';
|
||||||
case ShellFunc.process:
|
case ShellFunc.process:
|
||||||
return 'process';
|
return 'process';
|
||||||
@@ -259,3 +260,13 @@ const _bsdStatusCmd = [
|
|||||||
//'sysctl -a | grep temperature',
|
//'sysctl -a | grep temperature',
|
||||||
'hostname',
|
'hostname',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
extension StatusCmdTypeX on StatusCmdType {
|
||||||
|
String get i18n => switch (this) {
|
||||||
|
StatusCmdType.sys => l10n.system,
|
||||||
|
StatusCmdType.host => l10n.host,
|
||||||
|
StatusCmdType.uptime => l10n.uptime,
|
||||||
|
StatusCmdType.battery => l10n.battery,
|
||||||
|
final val => val.name,
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user