firebase-tools-extra
Version:
Extra functionality for firebase-tools with support for emulators and auth through service account.
20 lines (19 loc) • 909 B
JavaScript
import { firestoreGet } from '../actions/firestore';
/**
* @name firestoreGet
* fetch and print JSON data at the specified path of Firestore. Works for both hosted and emulated environments
* @param {object} program - Commander program
*/
export default function firestoreGetCommand(program) {
program
.command('firestore:get <path>')
.description('fetch and print JSON data at the specified path of Firestore. Works for both hosted and emulated environments')
.option('-o, --output <filename>', 'save output to the specified file')
.option('--emulator', 'use Firestore emulator')
.option('--debug', 'print verbose debug output to console')
.action(function (dbPath, options) {
return firestoreGet(dbPath, options)
.then(function () { return process.exit(0); })
.catch(function () { return process.exit(1); });
});
}