Skip to content

Commit

Permalink
test: fix os-release check for Ubuntu in SEA test
Browse files Browse the repository at this point in the history
For example, my `/etc/os-release` file begins with

```
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
```

so in order to match the regexp here, the `/m` flag is necessary.

PR-URL: #46838
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
addaleax authored and targos committed Mar 13, 2023
1 parent 8fb19f7 commit 822b008
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-single-executable-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (process.config.variables.want_separate_host_toolset !== 0)
if (process.platform === 'linux') {
try {
const osReleaseText = readFileSync('/etc/os-release', { encoding: 'utf-8' });
if (!/^NAME="Ubuntu"/.test(osReleaseText)) {
if (!/^NAME="Ubuntu"/m.test(osReleaseText)) {
throw new Error('Not Ubuntu.');
}
} catch {
Expand Down

0 comments on commit 822b008

Please sign in to comment.