mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
21 lines
775 B
Dart
21 lines
775 B
Dart
|
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();
|
||
|
final config = json.decode(inoutContent);
|
||
|
final output =
|
||
|
'const salt = \'${config["salt"]}\';\nconst key = \'${config["key"]}\';\nconst walletSalt = \'${config["walletSalt"]}\';\nconst shortKey = \'${config["shortKey"]}\';\nconst change_now_api_key = \'${config["change_now_api_key"]}\';';
|
||
|
|
||
|
File(outputPath).writeAsString(output);
|
||
|
}
|