Skip to content

Commit

Permalink
fix: remove require in get-tray-bin-path
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar-P-yan committed May 12, 2024
1 parent fb197cd commit 1389c46
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ var path__namespace = /*#__PURE__*/_interopNamespace(path);
var os__namespace = /*#__PURE__*/_interopNamespace(os);
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);

// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');
function getTrayBinPath(debug = false, copyDir = false) {
const binName = {
win32: `tray_windows${debug ? '' : '_release'}.exe`,
Expand All @@ -56,6 +54,8 @@ function getTrayBinPath(debug = false, copyDir = false) {
}
const binPath = path__namespace.resolve(`${__dirname}/../traybin/${binName}`);
if (copyDir) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');
copyDir = path__namespace.join(typeof copyDir === 'string'
? copyDir
: `${os__namespace.homedir()}/.cache/node-systray/`, pkg.version);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.esm.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import * as path from 'path';
import * as os from 'os';
import * as fs from 'fs-extra';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');
function getTrayBinPath(debug = false, copyDir = false) {
const binName = {
win32: `tray_windows${debug ? '' : '_release'}.exe`,
Expand All @@ -25,6 +23,8 @@ function getTrayBinPath(debug = false, copyDir = false) {
}
const binPath = path.resolve(`${__dirname}/../traybin/${binName}`);
if (copyDir) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');
copyDir = path.join(typeof copyDir === 'string'
? copyDir
: `${os.homedir()}/.cache/node-systray/`, pkg.version);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/get-tray-bin-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import * as path from 'path';
import * as os from 'os';
import * as fs from 'fs-extra';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');

export function getTrayBinPath(
debug = false,
copyDir: boolean | string = false,
Expand All @@ -26,6 +23,9 @@ export function getTrayBinPath(
const binPath = path.resolve(`${__dirname}/../traybin/${binName}`);

if (copyDir) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('../package.json');

copyDir = path.join(
typeof copyDir === 'string'
? copyDir
Expand Down
2 changes: 1 addition & 1 deletion types/get-tray-bin-path.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1389c46

Please sign in to comment.