mirror of
https://github.com/Ellpeck/WoodpeckerPlugins.git
synced 2024-11-22 02:23:29 +01:00
allow multiple glob patterns
This commit is contained in:
parent
be1321fa45
commit
9472407096
2 changed files with 40 additions and 37 deletions
|
@ -10,7 +10,8 @@ steps:
|
||||||
server: https://cloud.ellpeck.de # the server to use
|
server: https://cloud.ellpeck.de # the server to use
|
||||||
user: EllBot # the user
|
user: EllBot # the user
|
||||||
token: access-token # the access token, or password if 2FA is disabled
|
token: access-token # the access token, or password if 2FA is disabled
|
||||||
files: "**/*.md" # the file(s), uses glob pattern
|
files: # the file(s), uses glob patterns
|
||||||
|
- "**/*.md"
|
||||||
dest: Uploads/CoolMarkdownFiles # the destination directory
|
dest: Uploads/CoolMarkdownFiles # the destination directory
|
||||||
basedir: "." # optional, local base directory for files, defaults to .
|
basedir: "." # optional, local base directory for files, defaults to .
|
||||||
chunksize: # optional, chunk size in bytes, defaults to 52428800
|
chunksize: # optional, chunk size in bytes, defaults to 52428800
|
||||||
|
|
|
@ -28,7 +28,8 @@ upload();
|
||||||
async function upload() {
|
async function upload() {
|
||||||
let basePath = `${serverEnv}/remote.php/dav`;
|
let basePath = `${serverEnv}/remote.php/dav`;
|
||||||
const upload = new Upload(basePath, userEnv, userEnv, tokenEnv);
|
const upload = new Upload(basePath, userEnv, userEnv, tokenEnv);
|
||||||
let files = await glob.glob(filesEnv, { cwd: baseDir });
|
for (let pattern of filesEnv.split(",")) {
|
||||||
|
let files = await glob.glob(pattern, { cwd: baseDir });
|
||||||
if (!files.length)
|
if (!files.length)
|
||||||
console.log("No files to upload");
|
console.log("No files to upload");
|
||||||
for (let file of files) {
|
for (let file of files) {
|
||||||
|
@ -66,4 +67,5 @@ async function upload() {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue