diff --git a/nyalcf_cli/bin/nyalcf_cli.dart b/nyalcf_cli/bin/nyalcf_cli.dart index bf28398..f8be00b 100644 --- a/nyalcf_cli/bin/nyalcf_cli.dart +++ b/nyalcf_cli/bin/nyalcf_cli.dart @@ -6,7 +6,6 @@ import 'package:args/args.dart'; import 'package:nyalcf_core/storages/configurations/launcher_configuration_storage.dart'; import 'package:nyalcf_core/storages/injector.dart'; import 'package:nyalcf_core/utils/logger.dart'; -import 'package:nyalcf_env/init.dart'; import 'package:nyalcf_inject/nyalcf_inject.dart'; // Project imports: @@ -31,7 +30,6 @@ void printUsage(ArgParser argParser) { } void main(List arguments) async { - initEnv(); /// 加载环境 setAppendInfo('CLI v$version an=${Platform.executable}'); diff --git a/nyalcf_env/lib/init.dart b/nyalcf_env/lib/init.dart deleted file mode 100644 index 796aae1..0000000 --- a/nyalcf_env/lib/init.dart +++ /dev/null @@ -1,6 +0,0 @@ -// Package imports: -import 'package:dotenv/dotenv.dart'; - -void initEnv() { - DotEnv(includePlatformEnvironment: true).load(); -} diff --git a/nyalcf_env/lib/src/gui.dart b/nyalcf_env/lib/src/gui.dart index 4adc036..8ff3426 100644 --- a/nyalcf_env/lib/src/gui.dart +++ b/nyalcf_env/lib/src/gui.dart @@ -1,7 +1,7 @@ -// Dart imports: -import 'dart:io'; +// Package imports: +import 'package:dotenv/dotenv.dart'; -final _env = Platform.environment; +final _env = DotEnv(includePlatformEnvironment: true)..load(); bool? ENV_GUI_DISABLE_AUTO_UPDATE_CHECK = bool.tryParse( _env['NYA_LCF_DISABLE_AUTO_UPDATE_CHECK'] ?? '', diff --git a/nyalcf_env/lib/src/universal.dart b/nyalcf_env/lib/src/universal.dart index e2ee478..01491d0 100644 --- a/nyalcf_env/lib/src/universal.dart +++ b/nyalcf_env/lib/src/universal.dart @@ -1,7 +1,7 @@ -// Dart imports: -import 'dart:io'; +// Package imports: +import 'package:dotenv/dotenv.dart'; -final _env = Platform.environment; +final _env = DotEnv(includePlatformEnvironment: true)..load(); String? ENV_UNIVERSAL_FRPC_PATH = _env['NYA_LCF_FRPC_PATH']; String? ENV_UNIVERSAL_FRPC_DOWNLOAD_MIRROR_URL = diff --git a/nyalcf_gui/lib/main.dart b/nyalcf_gui/lib/main.dart index 5c7629f..835fd8a 100644 --- a/nyalcf_gui/lib/main.dart +++ b/nyalcf_gui/lib/main.dart @@ -17,7 +17,6 @@ import 'package:nyalcf_core_extend/utils/path_provider.dart'; import 'package:nyalcf_core_extend/utils/task_scheduler.dart'; import 'package:nyalcf_core_extend/utils/theme_control.dart'; import 'package:nyalcf_core_extend/utils/universe.dart'; -import 'package:nyalcf_env/init.dart'; import 'package:nyalcf_env/nyalcf_env.dart'; import 'package:nyalcf_inject/nyalcf_inject.dart'; import 'package:nyalcf_ui/main_tray.dart'; @@ -41,7 +40,6 @@ final _appLinks = AppLinks(); bool _appInit = false; void main() async { - initEnv(); /// 确保前置内容完成初始化 WidgetsFlutterBinding.ensureInitialized();