mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
CAKE-272 | refactored script
This commit is contained in:
parent
ff8ed30483
commit
b009b2a6e4
1 changed files with 81 additions and 78 deletions
|
@ -28,11 +28,19 @@ Future<void> main(List<String> args) async {
|
|||
: <String, dynamic> {srcDir : inputPath};
|
||||
|
||||
extraInfo.forEach((key, dynamic value) async {
|
||||
if (key == srcDir) {
|
||||
if (key != srcDir) {
|
||||
print('Wrong key: $key');
|
||||
return;
|
||||
}
|
||||
|
||||
final dirPath = value as String;
|
||||
final dir = Directory(dirPath);
|
||||
|
||||
if (await dir.exists()) {
|
||||
if (!await dir.exists()) {
|
||||
print('Wrong directory path: $dirPath');
|
||||
return;
|
||||
}
|
||||
|
||||
final localePath = <String, dynamic>{};
|
||||
await dir.list(recursive: false).forEach((element) {
|
||||
try {
|
||||
|
@ -43,7 +51,11 @@ Future<void> main(List<String> args) async {
|
|||
}
|
||||
});
|
||||
|
||||
if (localePath.keys.contains(defaultLocale)) {
|
||||
if (!localePath.keys.contains(defaultLocale)) {
|
||||
print("Locale list doesn't contain $defaultLocale");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var output = '';
|
||||
var locales = 'const locales = [';
|
||||
|
@ -99,15 +111,6 @@ Future<void> main(List<String> args) async {
|
|||
} catch (e) {
|
||||
print(e.toString());
|
||||
}
|
||||
} else {
|
||||
print("Locale list doesn't contain $defaultLocale");
|
||||
}
|
||||
} else {
|
||||
print('Wrong directory path: $dirPath');
|
||||
}
|
||||
} else {
|
||||
print('Wrong key: $key');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue