This updates js-yaml to 4.1.0 and swaps out `yaml.safeLoad()` for
`yaml.load()` because the `safe*` functions are deprecated starting in
4.0.0 (the "regular" functions are considered safe).
No change to logic. This updates codecov/codecov-action to v4. This
version supposedly has better support for external contributors working
from repository forks.
Tested this out with PR #1168.
This deprecates support for configuring `config.globOptions`. Exposing
this variable makes it difficult to change (or upgrade) our glob
library. This discourages users from depending on this config option
going forward.
If anyone is using `config.globOptions` then it should continue to
function, however this support is not promised for the long-term.
As far as I know, this is not a commonly used option:
https://github.com/shelljs/shelljs/issues?q=globOptions currently shows
no GitHub issues of users using this option, and there was never really
a motivation for why this needed to be exposed (#400 exposed the option
just because we could, not because we should).
This is one step toward supporting Issue #828.
No change to logic. GitHub Actions recently dropped some NodeJS configurations from their service. This excludes those configs from our CI.
This also adds Node versions up through v22.
Test: npm run check-node-support
No change to logic. This updates some test cases to create the files
they need inside the temp directory instead of in the repo itself. This
is helpful in case the test case fails early, that way we don't leave
this file behind.
This contributes toward #828, since the change to fast-glob made it
clear that this test was mishandling link files and leaving side effects
in the git repo. However this change is desirably independent of
fast-glob.
I tried this recently in 1a1a820569f0883a317944973c15cf34431dd6c2 and
then reverted in b8b1c4224d0ec7d631d26c78922c018dd5b895f5. Unfortunately
I'm still seeing spurious failures from codecov, so let's try the token
one more time.
This time I double checked the token is provided by
https://app.codecov.io/gh/shelljs/shelljs/settings. I regenerated the
token for good measure.
This changes the README to use a standard shields.io badge for GitHub
Actions. The custom badge
(https://github.com/Atrox/github-actions-badge) was cool, but the
atrox.dev link doesn't work reliably. I noticed that shields has support
for this now, so there's no reason to use a custom badge.
One notably difference is that this badge says the build is passing even
if there's a job still in progress.
This adds test coverage for the shell.exit() function. This also
refactors how we mock stdout/stderr and adds support for mocking
process.exit() (which was needed for this change).
While I was writing these tests, I realized there was an edge case I
missed in PR #1122. This change fixes that edge case.
Issue #1013
It looks like 1a1a820569f0883a317944973c15cf34431dd6c2 actually broke
codecov. Codecov is currently trying to diff all PRs against the commit
before that one, which leads to flagging previously-added lines of code
as needing coverage in the current PR.
Let's try removing the token and see if codecov is happy again.
Fixes#1124
No change to logic. This updates nyc (code coverage tool) to version 15,
which works around a breaking change that snuck into the latest Node LTS
versions.
Unfortunately, this version of nyc appears to break Node 8 and 9. We
need to work around this problem by skipping test coverage on those
versions.
Fixes#1130
This changes shell.exit() to use a wrapper function. This is so that
shell.errorCode() will have the correct error code after invoking
shell.exit(code). This isn't normally relevant, however a caller may be
listening for the exit status:
```
process.on('exit', code => {
shell.exit(shell.errorCode());
});
```
Issue #1013
No change to logic. This expands on the `touch()` command documentation
to make it more obvious how to use multiple options, long options, etc.
This also renames a variable in a test case to make the usage more
obvious.
No change to logic. This documents that we support importing via
`import shell from 'shelljs'`.
Related to issue #1071, although some more investigation is required to
understand why the other syntax doesn't work.
This fixes several issues with the cp -Ru test cases:
* Originally, I noticed the touch syntax looked wrong
* After fixing that, I was trying to figure out how the test case was
even passing before. I realized one of the assertions was wrong (it
was asserting sourceFile contents, but should have asserted destFile
contents)
* I realized the test should have created a nested destination
directory; without proper nesting, the sourceFile never actually
collided with destFile during the copy
* Lastly, I swapped touch() usage to use hardcoded timestamps for test
consistency
File permissions on Windows are weird. This adds a brief note into the
README that this is something to watch out for. As far as I'm aware, WSL
completely avoids the weirdness because it's actually Linux (and so it
follows POSIX).
No change to logic. This documents `shell.ls('-l')`'s `.toString()`
override. I noticed this feature was not documented. This string format
should not be depended on by programmatic usage, but it's useful to make
things more human readable.
No change to logic. This adds a test case to make sure the caret
character ('^') is passed through to the command. This is to make sure
the character is not treated specially on Windows, where it's an escape
character in the shell.
Fixes#1015
This adds testing for node v14. This removes testing for node v6 and v7
because codecov breaks on these versions. This omits node v15 because
appveyor doesn't seem to support this version. The nodejs org currently
supports [10, 12, 14, 15].
This makes a couple minor edits to the check-node-support script for
consistency with shelljs/shx#186.
This bumps the shx dependency because it seems we're hitting issue #973
on node v14.
Test: npm run check-node-support