add license file to npm publish (#11705)
This commit is contained in:
parent
39554566cc
commit
4757980f9c
1 changed files with 4 additions and 2 deletions
|
@ -21,7 +21,8 @@ const files = [
|
||||||
'index.js',
|
'index.js',
|
||||||
'install.js',
|
'install.js',
|
||||||
'package.json',
|
'package.json',
|
||||||
'README.md'
|
'README.md',
|
||||||
|
'LICENSE'
|
||||||
]
|
]
|
||||||
|
|
||||||
const jsonFields = [
|
const jsonFields = [
|
||||||
|
@ -49,9 +50,10 @@ new Promise((resolve, reject) => {
|
||||||
tempDir = dirPath
|
tempDir = dirPath
|
||||||
// copy files from `/npm` to temp directory
|
// copy files from `/npm` to temp directory
|
||||||
files.forEach((name) => {
|
files.forEach((name) => {
|
||||||
|
const noThirdSegment = name === 'README.md' || 'LICENSE'
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(tempDir, name),
|
path.join(tempDir, name),
|
||||||
fs.readFileSync(path.join(__dirname, '..', name === 'README.md' ? '' : 'npm', name))
|
fs.readFileSync(path.join(__dirname, '..', noThirdSegment ? '' : 'npm', name))
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
// copy from root package.json to temp/package.json
|
// copy from root package.json to temp/package.json
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue