-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
The action tries to move the plugin from . to lib/plugin/<name>:
| moveContents('.', config.dir); |
This is executed here:
github-action/.github/actions/dokuenv/index.js
Lines 13 to 35 in 6c44fb3
| function moveContents(sourceDir, destinationDir) { | |
| // read contents first | |
| const items = fs.readdirSync(sourceDir); | |
| // then create destination dir if it doesn't exist | |
| if (!fs.existsSync(destinationDir)) { | |
| fs.mkdirSync(destinationDir, {recursive: true}); | |
| } | |
| for (const item of items) { | |
| const sourcePath = path.join(sourceDir, item); | |
| const destinationPath = path.join(destinationDir, item); | |
| const stats = fs.statSync(sourcePath); | |
| if (stats.isFile()) { | |
| fs.renameSync(sourcePath, destinationPath); | |
| } else if (stats.isDirectory()) { | |
| moveContents(sourcePath, destinationPath); | |
| fs.rmdirSync(sourcePath); | |
| } | |
| } | |
| } |
Line 15 will read the list of all files and directories. This will include a lib directory if it exists in the plugin.
It then proceeds to copy all files to lib, recursing into directories. It will try to copy lib to lib which is interpreted as lib -> lib/lib. The next recursion will find this lib/lib creating lib/lib/lib and so on.
Metadata
Metadata
Assignees
Labels
No labels