←back to thread

167 points jgrahamc | 3 comments | | HN request time: 0.001s | source
Show context
bouke ◴[] No.43557162[source]
So the real problem is that Jest just executes to whatever `sl` resolves. The fix they intent to release doesn't address that, but it tries to recognise the train steaming through. How is this acceptable behaviour from a test runner, as it looks like a disaster to happen. What if I have `alias sl=rm -rf /`, as one typically wants to have such a command close at hand?
replies(4): >>43557349 #>>43557468 #>>43557711 #>>43558209 #
blueflow ◴[] No.43557468[source]
What else should the test runner do?
replies(2): >>43557612 #>>43557677 #
1. pavel_lishin ◴[] No.43557677[source]
There must be a better way to tell if a repo is a Sapling repo than by running some arbitrary binary, right?
replies(1): >>43558575 #
2. Symbiote ◴[] No.43558575[source]
For Git one could look for .git/config. There must be something equivalent.
replies(1): >>43575840 #
3. remram ◴[] No.43575840[source]
.git will be a file and not a directory, if you are in a submodule or a worktree.

You just illustrated why trying to assume the functionality of a third-party app instead of calling it creates even more bugs.