Files
GitJournal/scripts/setup_env.dart
Vishesh Handa 2505d00dfb Replace dart:io with universal_io
Platform from dart:io cannot be used on the web for reasons. And this
way we get a fake File/Directory class which we can use for atleast
running the web version, even if it won't work.
2021-07-30 11:39:26 +02:00

15 lines
317 B
Dart
Executable File

#!/usr/bin/env dart
import 'dart:convert';
import 'package:universal_io/io.dart';
Future<void> main() async {
final config = {
'sentry': Platform.environment['SENTRY_DSN'],
};
final filename = 'lib/.env.dart';
await File(filename)
.writeAsString('final environment = ${json.encode(config)};');
}