Skip to content

Commit e1e3dd1

Browse files
ci(publish): try to find .npmrc, but don't fail if not found
1 parent d0e4f74 commit e1e3dd1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/release-prep.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ fs.writeFileSync(__dirname + '/../out/package.json', Buffer.from(JSON.stringify(
2020
fs.writeFileSync(__dirname + '/../out/version.txt', Buffer.from(sourceObj.version, 'utf-8'))
2121

2222
fs.cpSync(__dirname + '/../typings', __dirname + '/../out/declarations', { recursive: true })
23-
fs.copyFileSync(__dirname + '/../.npmrc', __dirname + '/../out/.npmrc')
23+
try {
24+
fs.copyFileSync(__dirname + '/../.npmrc', __dirname + '/../out/.npmrc')
25+
} catch {
26+
try {
27+
fs.copyFileSync(__dirname + '/../../.npmrc', __dirname + '/../out/.npmrc')
28+
} catch {
29+
console.warn('Build Warning: no .npmrc')
30+
}
31+
}
2432
fs.copyFileSync(__dirname + '/../LICENSE', __dirname + '/../out/LICENSE')
2533
fs.copyFileSync(__dirname + '/../README.md', __dirname + '/../out/README.md')
2634
fs.copyFileSync(__dirname + '/../SECURITY.md', __dirname + '/../out/SECURITY.md')

0 commit comments

Comments
 (0)