Passed
Push — main ( 6aef38...e372cf )
by Patrick
01:52
created

examples/dependabot/1.0.0/copy-files-to-repo.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 20
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 0
1
/** @type {import('@/lib/Boost').BoostScriptHandler} */
2
module.exports.handler = async function ({
3
    boost, git, repository, tools 
4
}) {
5
    boost.log('copying files to repository...');
6
7
    const filelist = tools.recursiveDirectoryCopy(`${boost.path}/files`, repository.path, (src, dest) => {
8
        boost.log('copied file: ' + dest.replace(repository.path, '.'));
9
    });
10
11
    boost.log('finished, total files copied: ' + filelist.length);
12
13
    if (filelist.length) {
14
        await git.add(filelist);
15
        await git.commit('add dependabot support');
16
17
        boost.log('committed changes to git');
18
    }
19
20
    return true;
21
};
22