28 Commits

Author SHA1 Message Date
Aurélio A. Heckert
7d6c1a88a1 fix: Replace jade references by pug
close #1595
2019-10-15 19:27:50 -04:00
Remy Sharp
e41f3c3aad feat: feed args to exec when detecting script (#1273)
Fixes #1263

The way it works:

- If the script is detected via index.js from the directory, or from the
package, then all the arguments on the CLI are shifted to execArgs

- If there was a double-dash on the CLI args, then only those before the
double-dash are given to execArgs and the rest remain passed to the
script
2018-02-27 16:42:32 +00:00
Josef Brandl
d78bf3d5d1 fix: watch both js and mjs files if main file is JavaScript 2017-12-29 16:51:17 +00:00
Dominykas Blyžė
009d868516 feat: support wildcard extension matching 2017-12-20 14:08:32 +00:00
Remy Sharp
a282afbbe3 fix: support nodemon index to expand to index.js
With support for custom extensions (picking only the first).

Fixes #1165
2017-12-15 08:45:49 +00:00
Marcus Noble
ff935cae7f test: Test support for multi-level filenames 2017-10-08 16:02:15 +01:00
Remy Sharp
b95469aeb4 test: check non-english chrs don't blow up 2016-02-25 11:14:27 +00:00
Remy Sharp
f5d1a04cc8 test: fix default node ext to js,json
@pensierinmusica this was the fix you needed to pass the tests.
2015-10-25 07:14:49 +00:00
Doug Patti
56c4caf2ed pull command stringification into a utility
This was copied and pasted more than a handful of times around the
library and tests. Some implementations were more naive and did not
try to add quotes if there are spaces within a single argument.

There is one slight oddity in one of the cli parse tests. Stringifying
the command causes many of the arguments to show up in quotes when they
probably shouldn't. This seems to trace back to a deep problem related
to how commands are pulled out of package.scripts.start and is out of
scope for this patch. Even though the test might look incorrect now, it
is an accurate reflection of what the generated command is.
2015-04-22 13:42:55 -04:00
Doug Patti
a71db72ece when running a coffee file, use --nodejs correctly
Previously, the --nodejs flag was being prepended if you had any
arguments prefixed with '--', even if they were intended for your
application. There is an additional problem where arguments intended for
node js need to be grouped into a single argument passed after --nodejs.

After this patch, any flag before your script is considered a nodejs
argument. These, along with any other exec arguments are bundled into a
single argument separated by spaces.

Fixes #530
2015-04-22 13:42:52 -04:00
Remy Sharp
d796e41120 Remove the need for execArgs when user specifying an exec
- Also update tests to check end value, not individual parts
- Simplify tests to check actual output, rather than the pieces that make the output
- Remove redundant code: such a shame, it was cool code, but I'd rather remove it for simplicity and better support. Woot.
2015-02-01 15:59:49 +00:00
Remy Sharp
b70b81612c Removed script, exec, ext from options
This commit removes the duplication that happened at the options and options.execOptions level. Now all exec related information lives in options.execOptions.

I've updated all the references and tests that referred to things like options.script, etc.

This also fixes the (new) bug with exec argments not being placed in the right position when the script is detected via a package (so it reads `node --debug app.js` - this is resolved in command.js (due to the flattening of the config).

I've also fixed a few tests that said they were passing, but actually should have failed (but didn't because I was mocking too much of the code).
2015-01-03 15:35:11 +00:00
Remy Sharp
8a43b58666 Fixed failing tests
The execArgs is now a single element, not an array to simplify the spawn command, so I've fixed up the tests to reflect that.
2015-01-01 21:46:01 +00:00
Remy Sharp
df166ab870 Merging @gfxmonk's exec tests 2014-12-09 13:35:55 +00:00
Remy Sharp
8e3ba1c662 Fixed string interpolation with array exec 2014-12-09 12:24:50 +00:00
Remy Sharp
93113c9d70 Better tests for scripts with spaces 2014-12-08 18:31:25 +00:00
Remy Sharp
acf4d61c79 Correctly parse exec when there's spaces
Closes #418
Closes #419

This version will handle quoted entities in the exec string or escaped spaces correctly, so the user can run:

--exec '"/bin/my cool app" {{filename}}'

Or

--exec '/bin/my\ cool\ app {{filename}}'

This will work both on the command line and from the API.
2014-12-08 09:16:16 +00:00
Remy Sharp
6adea0e893 Tests to show failing support 2014-12-08 08:31:47 +00:00
Remy Sharp
d97d92f65b Tweak output of tests to see what's failing 2014-12-05 22:44:40 +00:00
Remy Sharp
2a2f1260e4 If no script, default is null, not -1. Fixes #265
Includes test and exposing the command run for debugging.
2014-01-21 07:57:27 +00:00
Remy Sharp
8eef00b334 Add new tests for match code and updated for monitor format. 2014-01-05 00:44:56 +00:00
Remy Sharp
1fcc30d272 Fixing coffeescript tests for windows 2013-12-15 13:56:33 +00:00
Remy Sharp
05e5cecfe7 test for --debug=X 2013-12-11 15:16:32 +00:00
Remy Sharp
999f87eeda Support for execMap #195 and tests 2013-12-10 13:29:35 +00:00
Remy Sharp
c503222f30 Refactoring.
* userScript => script
* simplified exec library
* removed dead code in config loading
* nodemon now knows when it's being required (and goes dark)
* etc...
2013-12-03 13:34:40 +00:00
Remy Sharp
5293f08740 fixed parse test expectation 2013-08-07 23:51:53 +01:00
Remy Sharp
c5f2bee160 Testing the exec rules and the parser
Still lots to do, but taking a very code, test, code, test, test, test, code, test cycle.
2013-08-05 22:55:12 +01:00
Remy Sharp
3efca971fd Argument parsing, and executable support and tests
Includes simple passing tests, the exec.js has not been tested in detail yet.
2013-08-05 00:11:30 +01:00