2020-01-04 19:31:52 +00:00
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
const secretsProdPath = 'tool/.secrets-prod.json';
|
|
|
|
const secretsTestPath = 'tool/.secrets-test.json';
|
|
|
|
const outputPath = 'lib/.secrets.g.dart';
|
|
|
|
|
|
|
|
Future<void> main() async {
|
|
|
|
final inputPath = FileSystemEntity.typeSync(secretsProdPath) !=
|
|
|
|
FileSystemEntityType.notFound
|
|
|
|
? secretsProdPath
|
|
|
|
: secretsTestPath;
|
|
|
|
|
|
|
|
final inoutContent = File(inputPath).readAsStringSync();
|
2020-01-08 13:59:37 +00:00
|
|
|
final config = json.decode(inoutContent) as Map<String, dynamic>;
|
2020-01-04 19:31:52 +00:00
|
|
|
final output =
|
2020-09-23 18:26:10 +00:00
|
|
|
'const salt = \'${config["salt"]}\';const keychainSalt = \'${config["keychainSalt"]}\';\nconst key = \'${config["key"]}\';\nconst walletSalt = \'${config["walletSalt"]}\';\nconst shortKey = \'${config["shortKey"]}\';\nconst change_now_api_key = \'${config["change_now_api_key"]}\';';
|
2020-01-04 19:31:52 +00:00
|
|
|
|
2020-01-08 12:26:34 +00:00
|
|
|
await File(outputPath).writeAsString(output);
|
2020-01-04 19:31:52 +00:00
|
|
|
}
|