Skip to content

Commit

Permalink
fix: udev file content reading on non Linux platform (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
ert78gb authored and mondalaci committed Jan 21, 2020
1 parent 011912f commit 97c9905
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/uhk-agent/src/util/get-udev-file-content-async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { promisify } from 'util';
const readFileAsync = promisify(readFile);

export async function getUdevFileContentAsync(rootDir: string): Promise<string> {
if (process.platform !== 'linux') {
return '';
}

const filePath = join(rootDir, 'rules/50-uhk60.rules');

return readFileAsync(filePath, { encoding: 'utf-8' });
Expand Down

0 comments on commit 97c9905

Please sign in to comment.