UNPKG

firebase-tools-extra

Version:

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

23 lines (22 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var firestore_1 = require("../actions/firestore"); /** * @name firestoreUpdate * update data at specified path of Firestore. Work for both hosted and emulated environments * @param {object} program - Commander program */ function firestoreUpdateCommand(program) { program .command('firestore:update <path> [infile]') .description('Update data at 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 firestore_1.firestoreWrite('update', dbPath, inFile, options) .then(function () { return process.exit(0); }) .catch(function () { return process.exit(1); }); }); } exports.default = firestoreUpdateCommand;