Trying to read file

This commit is contained in:
HugoTextNow 2024-04-05 11:30:21 -07:00 committed by GitHub
parent 82c7e631bb
commit 97f94fd3de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,11 +167,9 @@ async function getMacOSInfo() {
}
export async function getLinuxInfo() {
const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true
});
const pyprojectFile = fs.readFileSync('/etc/os-release').toString();
const [osName, osVersion] = stdout.trim().split('\n');
const [osName, osVersion] = pyprojectFile.match(/ID="?(.+)"?/gm);
core.debug(`OS Name: ${osName}, Version: ${osVersion}`);