baidubce-cli
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "baidubce-cli", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "baidu cloud engine command line tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -51,3 +51,3 @@ /** | ||
.options('copy-object', {describe: 'Copy object from one bucket to another', 'boolean': true}) | ||
.example('baidubce bos --copy-object bos://source/sk.js bos://target/tk.js', | ||
.example('baidubce bos --copy-object bos://source/sk.js bos://target/tk.js <options>', | ||
'Copy object from one bucket to another') | ||
@@ -135,3 +135,3 @@ | ||
var key = getKey(args); | ||
var client = getClient(args, bucket_name); | ||
var client = getClient(bucket_name); | ||
@@ -157,2 +157,11 @@ if (args['put-object']) { | ||
function safeParse(text) { | ||
try { | ||
return JSON.parse(text); | ||
} | ||
catch (ex) { | ||
return null; | ||
} | ||
} | ||
function copyObject(args) { | ||
@@ -166,2 +175,3 @@ if (args.length !== 2) { | ||
var target = args[1]; | ||
var options = safeParse(args[2]); | ||
@@ -187,3 +197,3 @@ var m1 = kPattern.exec(source); | ||
return c1.copyObject(source_bucket_name, source_key, | ||
target_bucket_name, target_key).then(function (response) { | ||
target_bucket_name, target_key, options).then(function (response) { | ||
console.log('DONE'); | ||
@@ -190,0 +200,0 @@ }).catch(function (error) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21046
499