Skip to content

Commit

Permalink
[ Fix ] fixed issues in term in compatability with the configuration …
Browse files Browse the repository at this point in the history
…logic
  • Loading branch information
anasfik committed Oct 17, 2023
1 parent d8a1405 commit bfeb59d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

## 0.9.42

- Bug Fixes in comptaibility with the new depency inversion principle of the configuration logic.
- Added support for json configuration in addition of the yaml configuration, with the default one being yaml, the user can specify it with the `--json`, `--yaml`...
- Added syntax highlighting for the configuration files.
Binary file modified bin/langsync.exe
Binary file not shown.
1 change: 0 additions & 1 deletion lib/src/commands/start_command/start_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'dart:io';
import 'package:args/command_runner.dart';
import 'package:hive/hive.dart';
import 'package:langsync/src/etc/controllers/config_file.dart';
import 'package:langsync/src/etc/controllers/yaml.dart';
import 'package:langsync/src/etc/extensions.dart';
import 'package:langsync/src/etc/models/lang_output.dart';
import 'package:langsync/src/etc/models/result_locale.dart';
Expand Down
8 changes: 5 additions & 3 deletions lib/src/etc/models/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ class LangSyncConfig extends Equatable {
factory LangSyncConfig.fromMap(Map<dynamic, dynamic> map) {
final langsyncMapField = map['langsync'] as Map;

final target = (langsyncMapField['target'] as YamlList)
.nodes
.map((e) => e.value as String);
final targetField = langsyncMapField['target'];

final target = targetField is YamlList
? (targetField as YamlList).nodes.map((e) => e.value as String)
: (targetField as List<dynamic>).map((e) => e as String);

return LangSyncConfig(
sourceFile: langsyncMapField['source'] as String,
Expand Down

0 comments on commit bfeb59d

Please sign in to comment.