Forwarded: https://github.com/nodejs/node/issues/44840
Last-Update: 2022-10-01
Gbp-Pq: Topic armel
Gbp-Pq: Name nopi.patch
const isLinux = process.platform === 'linux';
const isOSX = process.platform === 'darwin';
const isPi = (() => {
- try {
- // Normal Raspberry Pi detection is to find the `Raspberry Pi` string in
- // the contents of `/sys/firmware/devicetree/base/model` but that doesn't
- // work inside a container. Match the chipset model number instead.
- const cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' });
- return /^Hardware\s*:\s*(.*)$/im.exec(cpuinfo)?.[1] === 'BCM2835';
- } catch {
- return false;
- }
+ return false;
})();
const isDumbTerminal = process.env.TERM === 'dumb';