Skip to content

Commit

Permalink
👷 Add script for windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaoz-Topsy committed Jul 24, 2024
1 parent 0fba908 commit 3fb74a1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/create_env_file.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// ignore_for_file: avoid_print

import 'dart:convert';
import 'dart:io';

Future<void> main() async {
Map<String, String> env = Platform.environment;

final file = File('./lib/env.dart');
String? contentsInBase64 = env['ENV_DART'];
if (contentsInBase64 == null) {
print('Environment variable is empty');
return;
}
Codec<String, String> stringToBase64 = utf8.fuse(base64);
String contents = stringToBase64.decode(contentsInBase64);
await file.writeAsString(contents);
print('Done');
}

0 comments on commit 3fb74a1

Please sign in to comment.