UNPKG

@yuntools/ali-oss

Version:

阿里云 OSS 命令行工具 ossutil 封装,支持 ESM,CJS 导入,提供 TypeScript 类型定义

28 lines 1.09 kB
import assert from 'node:assert'; import { commonProcessInputMap } from '../helper.js'; import { PlaceholderKey, } from '../types.js'; import { initOptions as mvOptions } from './mv.js'; export const initOptions = { ...mvOptions, target: '', src: '', encodeSource: true, }; export async function processInput(input, globalConfig) { const map = commonProcessInputMap(input, initOptions, globalConfig); assert(map.get(PlaceholderKey.dest), 'dest is required'); const bucket = map.get(PlaceholderKey.bucket); assert(bucket, 'bucket is required'); assert(typeof bucket === 'string', 'bucket must be string'); const src = map.get(PlaceholderKey.src); assert(src, 'src is required'); assert(typeof src === 'string'); assert(src.startsWith('oss://'), 'src must start with oss://'); const dest = map.get(PlaceholderKey.dest); assert(dest, 'dest is required'); // 命令行参数是目标在前,源在后!! map.set(PlaceholderKey.src, dest); map.set(PlaceholderKey.dest, src); return map; } //# sourceMappingURL=link.js.map