Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Commit 83e7070

Browse files
iarnazkat
authored andcommitted
1 parent 9d533d4 commit 83e7070

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/installer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,17 +321,17 @@ class Installer {
321321
if (pkg.scripts) {
322322
if (pkg.scripts.preinstall) {
323323
const old = pkg.scripts.preinstall
324-
pkg.scripts.preinstall = pkg.scripts.preinstall.replace('node', 'tish')
324+
pkg.scripts.preinstall = pkg.scripts.preinstall.replace(/\bnode([^-\w]|$)/, 'tish$1')
325325
modified = pkg.scripts.preinstall === old
326326
}
327327
if (pkg.scripts.install) {
328328
const old = pkg.scripts.install
329-
pkg.scripts.install = pkg.scripts.install.replace('node', 'tish')
329+
pkg.scripts.install = pkg.scripts.install.replace(/\bnode([^-\w]|$)/, 'tish$1')
330330
modified = pkg.scripts.install === old
331331
}
332332
if (pkg.scripts.postinstall) {
333333
const old = pkg.scripts.postinstall
334-
pkg.scripts.postinstall = pkg.scripts.postinstall.replace('node', 'tish')
334+
pkg.scripts.postinstall = pkg.scripts.postinstall.replace(/\bnode([^-\w]|$)/, 'tish$1')
335335
modified = pkg.scripts.postinstall === old
336336
}
337337
if (modified) {
@@ -391,7 +391,7 @@ class Installer {
391391
this.log('verbose', 'tinkifyBins', 'convering installed bins to use tink:', bins)
392392
return BB.map(bins, async bin => {
393393
const real = await realpathAsync(bin)
394-
const data = (await readFileAsync(real, 'utf8')).replace(/(#!\s*.*\s*)node/g, '$1tish')
394+
const data = (await readFileAsync(real, 'utf8')).replace(/^(#!.*\b)node([^-\w]|$)/g, '$1tish$2')
395395
await writeFileAsync(real, data, 'utf8')
396396
}, { concurrency: 50, Promise: BB })
397397
}

0 commit comments

Comments
 (0)