Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konifar/9fab3facfd4e1aa899f1e525177948d0 to your computer and use it in GitHub Desktop.
Save konifar/9fab3facfd4e1aa899f1e525177948d0 to your computer and use it in GitHub Desktop.
upload_sessions_to_firebase_database.dart
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
main() async {
var response = await http.read(
'https://raw.githubusercontent.com/konifar/droidkaigi2016/master/app/src/main/res/raw/sessions_ja.json');
var json = {'ja': JSON.decode(response)};
// https://github.com/firebase/firebase-tools/blob/master/commands/database-update.js
Process.run('firebase',
[
'database:update',
'--project',
'droidkaigi-f787d',
'/2016/sessions/',
'-y',
'-d',
JSON.encode(json),
],
).then((ProcessResult result) {
print(result.stdout);
print(result.stderr);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment