fix: minio client config & vault path validation
This commit is contained in:
parent
ed12a9e0f2
commit
3eb27c48ea
@ -197,7 +197,7 @@ function prepareVault(config) {
|
|||||||
let bucket = config["bucket"];
|
let bucket = config["bucket"];
|
||||||
let prefix = config["prefix"];
|
let prefix = config["prefix"];
|
||||||
|
|
||||||
let client = new Client(config);
|
let client = new Client(config["client"]);
|
||||||
let stream = client.listObjectsV2(bucket, prefix, true);
|
let stream = client.listObjectsV2(bucket, prefix, true);
|
||||||
|
|
||||||
stream.on('data', item => {
|
stream.on('data', item => {
|
||||||
@ -224,7 +224,7 @@ function prepareVault(config) {
|
|||||||
case "file":
|
case "file":
|
||||||
let path = config["path"];
|
let path = config["path"];
|
||||||
|
|
||||||
if (fs.existsSync(path) && fs.lstatSync(path).isDirectory) {
|
if (fs.lstatSync(path).isDirectory()) {
|
||||||
return new Promise((resolve) => resolve(path));
|
return new Promise((resolve) => resolve(path));
|
||||||
}
|
}
|
||||||
throw new Error(path + ": not a valid vault");
|
throw new Error(path + ": not a valid vault");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user