build/npm: don't copy dot files.

pull/2728/head
XhmikosR 2020-05-30 19:27:41 +03:00
parent 27ff009494
commit 6dbfd55091
5 changed files with 19 additions and 18 deletions

1
.gitignore vendored
View File

@ -36,4 +36,3 @@ TODO
test.html test.html
ad.js ad.js
/.cache/ /.cache/
/docs/assets/js/.eslintrc.json

View File

@ -1,7 +1,8 @@
'use strict' 'use strict'
const Plugins = require('./DocsPlugins') const path = require('path')
const fse = require('fs-extra') const fse = require('fs-extra')
const Plugins = require('./DocsPlugins')
class Publish { class Publish {
constructor() { constructor() {
@ -30,7 +31,12 @@ class Publish {
// Publish files // Publish files
Plugins.forEach(module => { Plugins.forEach(module => {
try { try {
fse.copySync(module.from, module.to) fse.copySync(module.from, module.to, {
// Skip copying dot files
filter(src) {
return !path.basename(src).startsWith('.')
}
})
if (this.options.verbose) { if (this.options.verbose) {
console.log(`Copied ${module.from} to ${module.to}`) console.log(`Copied ${module.from} to ${module.to}`)

View File

@ -1,7 +1,8 @@
'use strict' 'use strict'
const Plugins = require('./Plugins') const path = require('path')
const fse = require('fs-extra') const fse = require('fs-extra')
const Plugins = require('./Plugins')
class Publish { class Publish {
constructor() { constructor() {
@ -29,11 +30,18 @@ class Publish {
run() { run() {
// Publish files // Publish files
Plugins.forEach(module => { Plugins.forEach(module => {
const fseOptions = {
// Skip copying dot files
filter(src) {
return !path.basename(src).startsWith('.')
}
}
try { try {
if (fse.existsSync(module.from)) { if (fse.existsSync(module.from)) {
fse.copySync(module.from, module.to) fse.copySync(module.from, module.to, fseOptions)
} else { } else {
fse.copySync(module.from.replace('node_modules/', '../'), module.to) fse.copySync(module.from.replace('node_modules/', '../'), module.to, fseOptions)
} }
if (this.options.verbose) { if (this.options.verbose) {

View File

@ -1,6 +0,0 @@
root = true
[*.{js,css,less,html}]
indent_style = space
indent_size = 4
charset = utf-8

View File

@ -1,6 +0,0 @@
module.exports = {
"extends": "standard",
"plugins": [
"standard"
]
};