mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Generation of pubspec.yaml file
This commit is contained in:
parent
78fc443532
commit
469effd9ef
5 changed files with 36 additions and 1210 deletions
25
tool/generate_pubspec.dart
Normal file
25
tool/generate_pubspec.dart
Normal file
|
@ -0,0 +1,25 @@
|
|||
import 'dart:io';
|
||||
|
||||
const pubspecBasePath = 'pubspec_base.yaml';
|
||||
const pubspecDescriptionPath = 'pubspec_description.yaml';
|
||||
const outputPubspecPath = 'pubspec.yaml';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
final pubspecBase = File(pubspecBasePath);
|
||||
final pubspecDescription = File(pubspecDescriptionPath);
|
||||
|
||||
if (!pubspecBase.existsSync() || !pubspecDescription.existsSync()) {
|
||||
throw('$pubspecBasePath or $pubspecDescriptionPath doesn't exists');
|
||||
}
|
||||
|
||||
final pubspecBaseContent = await pubspecBase.readAsString();
|
||||
final pubspecDescriptionContent = await pubspecDescription.readAsString();
|
||||
final pubSpecContent = pubspecDescriptionContent + '\n\n' + pubspecBaseContent;
|
||||
final outputPubspec = File(outputPubspecPath);
|
||||
|
||||
if (outputPubspec.existsSync()) {
|
||||
await outputPubspec.delete();
|
||||
}
|
||||
|
||||
await outputPubspec.writeAsString(pubSpecContent);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue