UNPKG

firebase-tools-extra

Version:

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

20 lines (19 loc) 759 B
import { rtdbWrite } from '../actions/rtdb'; /** * @name databaseSet * store JSON data at the specified path * @param program - Commander program */ export default function databaseSetCommand(program) { program .command('database:set <path> [infile]') .description('store JSON data at the specified path') .option('-d, --data <data>', 'specify escaped JSON directly') .option('--emulator', 'use RTDB emulator') .option('--debug', 'print verbose debug output to console') .action(function (dbPath, inFile, options) { return rtdbWrite('set', dbPath, inFile, options) .then(function () { return process.exit(0); }) .catch(function () { return process.exit(1); }); }); }