Skip to content

Commit 3fb74a1

Browse files
committed
👷 Add script for windows build
1 parent 0fba908 commit 3fb74a1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scripts/create_env_file.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// ignore_for_file: avoid_print
2+
3+
import 'dart:convert';
4+
import 'dart:io';
5+
6+
Future<void> main() async {
7+
Map<String, String> env = Platform.environment;
8+
9+
final file = File('./lib/env.dart');
10+
String? contentsInBase64 = env['ENV_DART'];
11+
if (contentsInBase64 == null) {
12+
print('Environment variable is empty');
13+
return;
14+
}
15+
Codec<String, String> stringToBase64 = utf8.fuse(base64);
16+
String contents = stringToBase64.decode(contentsInBase64);
17+
await file.writeAsString(contents);
18+
print('Done');
19+
}

0 commit comments

Comments
 (0)