UNPKG

@bioneisme/greenfield-cli

Version:
36 lines (35 loc) 2.17 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const putObject_1 = require("../commands/object/putObject"); const commander_1 = require("commander"); const createFolder_1 = require("../commands/object/createFolder"); const downloadObject_1 = require("../commands/object/downloadObject"); const object = commander_1.program.command("object").description("object operations"); object .command("put <visibility> <filePath> <bucketNameAndPath>") .description('The "object put" command is used to upload a file from local which is less than 2G.') .action((visibility, filePath, bucketNameAndPath) => __awaiter(void 0, void 0, void 0, function* () { yield (0, putObject_1.putObject)(bucketNameAndPath, visibility, filePath); })); object .command("create-folder <bucketNameAndPath>") .description("Creates a Folder.") .action((bucketNameAndPath) => __awaiter(void 0, void 0, void 0, function* () { yield (0, createFolder_1.createFolder)(bucketNameAndPath); })); object .command("get <bucketNameAndPath> <filepath>") .description('The "object get" command is used to download an object to local path. This command will return the local file path where the object will be downloaded and the file size after successful execution.') .action((bucketNameAndPath, filepath) => __awaiter(void 0, void 0, void 0, function* () { yield (0, downloadObject_1.downloadObject)(bucketNameAndPath, filepath); })); exports.default = object;