UNPKG

firebase-tools-extra

Version:

Extra functionality for firebase-tools with support for emulators and auth through service account.

20 lines (19 loc) 891 B
import { firestoreWrite } from '../actions/firestore'; /** * @name firestoreSet * set data to specified path of Firestore. Work for both hosted and emulated environments * @param {object} program - Commander program */ export default function firestoreSetCommand(program) { program .command('firestore:set <path> [infile]') .description('set data to specified path of Firestore. Work for both hosted and emulated environments') .option('-d, --data <data>', 'specify escaped JSON directly') .option('--emulator', 'use Firestore emulator') .option('--debug', 'print verbose debug output to console') .action(function (dbPath, inFile, options) { return firestoreWrite('set', dbPath, inFile, options) .then(function () { return process.exit(0); }) .catch(function () { return process.exit(1); }); }); }