Skip to content

Commit

Permalink
Trying to fix dotenv usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Sep 13, 2024
1 parent 7113a21 commit d80ab9a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
2 changes: 0 additions & 2 deletions nyalcf_cli/bin/nyalcf_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -31,7 +30,6 @@ void printUsage(ArgParser argParser) {
}

void main(List<String> arguments) async {
initEnv();
/// 加载环境
setAppendInfo('CLI v$version an=${Platform.executable}');

Expand Down
6 changes: 0 additions & 6 deletions nyalcf_env/lib/init.dart

This file was deleted.

6 changes: 3 additions & 3 deletions nyalcf_env/lib/src/gui.dart
Original file line number Diff line number Diff line change
@@ -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'] ?? '',
Expand Down
6 changes: 3 additions & 3 deletions nyalcf_env/lib/src/universal.dart
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down
2 changes: 0 additions & 2 deletions nyalcf_gui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -41,7 +40,6 @@ final _appLinks = AppLinks();
bool _appInit = false;

void main() async {
initEnv();

/// 确保前置内容完成初始化
WidgetsFlutterBinding.ensureInitialized();
Expand Down

0 comments on commit d80ab9a

Please sign in to comment.