test: fix os-release check for Ubuntu in SEA test

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Anna Henningsen
2023-02-26 15:36:58 +01:00
committed by GitHub
parent 9c61d414c4
commit 33ca552c39

View File

@@ -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 {