UNPKG

686 BJavaScriptView Raw
1#!/usr/bin/env node
2"use strict";
3/*!
4 * Copyright 2018 Google LLC
5 *
6 * Use of this source code is governed by an MIT-style
7 * license that can be found in the LICENSE file or at
8 * https://opensource.org/licenses/MIT.
9 */
10Object.defineProperty(exports, "__esModule", { value: true });
11const _1 = require(".");
12const args = process.argv.slice(2);
13const opts = {
14 bucket: args[0],
15 file: args[1],
16};
17process.stdin
18 .pipe((0, _1.upload)(opts))
19 .on('error', console.error)
20 .on('response', (resp, metadata) => {
21 if (!metadata || !metadata.mediaLink)
22 return;
23 console.log('uploaded!');
24 console.log(metadata.mediaLink);
25});
26//# sourceMappingURL=cli.js.map
\No newline at end of file