Skip to content

Commit 5124ae9

Browse files
committed
Merge branch 'master' of github.com:remy/nodemon
* 'master' of github.com:remy/nodemon: chore: adding funding file chore: update stalebot feat: add message event fix: disable fork only if string starts with dash feat: add TypeScript to default execPath (#1552) fix: Quote zero-length strings in arguments (#1551)
2 parents 95fa05a + d84f421 commit 5124ae9

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

.github/FUNDING.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
2+
open_collective: nodemon

.github/stale.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ daysUntilClose: 7
66
exemptLabels:
77
- pinned
88
- security
9+
- not-stale
910
# Label to use when marking an issue as stale
1011
staleLabel: stale
1112
# Comment to post when marking an issue as stale. Set to `false` to disable

lib/config/defaults.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
execMap: {
88
py: 'python',
99
rb: 'ruby',
10+
ts: 'ts-node',
1011
// more can be added here such as ls: lsc - but please ensure it's cross
1112
// compatible with linux, mac and windows, or make the default.js
1213
// dynamically append the `.cmd` for node based utilities

lib/monitor/run.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function run(options) {
9191
const shouldFork =
9292
!config.options.spawn &&
9393
!inBinPath &&
94-
firstArg.indexOf('-') === -1 && // don't fork if there's a node exec arg
94+
!(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg
9595
firstArg !== 'inspect' && // don't fork it's `inspect` debugger
9696
executable === 'node' && // only fork if node
9797
utils.version.major > 4 // only fork if node version > 4
@@ -133,6 +133,12 @@ function run(options) {
133133
bus.stdout = child.stdout;
134134
bus.stderr = child.stderr;
135135
}
136+
137+
if (shouldFork) {
138+
child.on('message', function (message, sendHandle) {
139+
bus.emit('message', message, sendHandle);
140+
});
141+
}
136142
}
137143

138144
bus.emit('start');

lib/utils/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var utils = (module.exports = {
6969
args.map(function (arg) {
7070
// if an argument contains a space, we want to show it with quotes
7171
// around it to indicate that it is a single argument
72-
if (arg.indexOf(' ') === -1) {
72+
if (arg.length > 0 && arg.indexOf(' ') === -1) {
7373
return arg;
7474
}
7575
// this should correctly escape nested quotes

0 commit comments

Comments
 (0)