yandex / tartifacts

:package: Create artifacts for your assemblies
MIT License
20 stars 9 forks source link

general & specified settings #110

Closed blond closed 6 years ago

blond commented 6 years ago

Now it is impossible to specify different settings for several artifacts.

But we have real cases when need add or ignore dotFiles, emptyFiles and emptyDirs.

Need to give the ability to override options in artifact info.

const tartifacts = require('tartifacts');

const artifacts = [
    {
        name: 'artifact.tar.gz',
        patterns: 'sources/**',
        tar: true,
        gzip: { level: 1 }
    },
    {
        name: 'artifact-dir',
        patterns: 'sources/**',
        dotFiles: false // override general options
    },
];

tartifacts(artifacts, {
    root: __dirname,  // `process.cwd()` by default
    dotFiles: true,   // include dotfiles
    emptyFiles: true  // include empty files,
    emptyDirs: false  // include empty directories
})
.then(() => console.log('Copying and packaging of artifacts completed!'))
.catch(console.error);