mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
22 lines
605 B
Dart
22 lines
605 B
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'package:path/path.dart' as path;
|
|
|
|
void main(List<String> args) async {
|
|
if (args.isEmpty) {
|
|
throw ArgumentError("Expected an argument but none was passed");
|
|
}
|
|
|
|
var decodedSecret = utf8.decode(base64Decode(args.first));
|
|
final val = jsonDecode(decodedSecret);
|
|
if (val is! List) {
|
|
throw Exception(
|
|
"'SECRET' Environmental Variable isn't configured properly");
|
|
}
|
|
|
|
await File(path.join(
|
|
Directory.current.path, "lib/models/generated_secrets.dart"))
|
|
.writeAsString("final List<String> secrets = $decodedSecret;");
|
|
}
|