mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-18 02:07:37 +00:00
24 lines
661 B
Dart
24 lines
661 B
Dart
|
import 'dart:convert';
|
||
|
import 'dart:io';
|
||
|
import 'utils/utils.dart';
|
||
|
|
||
|
const configPath = 'tool/.secrets-config.json';
|
||
|
const outputPath = 'lib/.secrets.g.dart';
|
||
|
|
||
|
Future<void> main(List<String> args) async => importSecretsConfig();
|
||
|
|
||
|
Future<void> importSecretsConfig() async {
|
||
|
final outputFile = File(outputPath);
|
||
|
final input = json.decode(File(configPath).readAsStringSync())
|
||
|
as Map<String, dynamic> ??
|
||
|
<String, dynamic>{};
|
||
|
final output = input.keys
|
||
|
.fold('', (String acc, String val) => acc + generateConst(val, input));
|
||
|
|
||
|
if (outputFile.existsSync()) {
|
||
|
await outputFile.delete();
|
||
|
}
|
||
|
|
||
|
await outputFile.writeAsString(output);
|
||
|
}
|