Commit fe9b0730 authored by Dan Allen's avatar Dan Allen

patch libnpmpublish to populate the readmeFilename field during release [skip ci]

parent ac0d63c6
Pipeline #138887639 skipped
......@@ -57,6 +57,7 @@ release:
environment: releases
before_script:
- yarn global add [email protected]$(node -p 'require("./lerna.json").lerna') > /dev/null
- NODE_PATH=$(yarn global dir)/node_modules node scripts/patch-libnpmpublish.js
script:
- scripts/release.sh
# triggers release of Docker image
......
'use strict'
const fs = require('fs')
const { promisify } = require('util')
function patchSource (source) {
if (source.includes('readmeFilename: ')) return source
return source.replace(/^ *readme: .+$/m, (match) => `${match},\n${match.replace(/readme/g, 'readmeFilename')}`)
}
;(async () => {
const sourceFile = require.resolve('@evocateur/libnpmpublish/publish.js')
await promisify(fs.readFile)(sourceFile, 'utf8')
.then((source) => promisify(fs.writeFile)(sourceFile, patchSource(source)))
})()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment