Skip to content

Commit 2645907

Browse files
committed
Replace the PWD env var with process.cwd
1 parent 8d9cfb0 commit 2645907

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const exportsRegex = /^(Object\.)?module\.exports\./;
1717
const sourceRegex = /^\s+at (.+) \((.+):(\d+):\d+/;
1818

1919
const INDENT = ' '.repeat(13);
20-
const { PWD } = process.env;
20+
const CWD = process.cwd();
2121

2222
function formatTime(time) {
2323
if (!time) return time;
@@ -66,7 +66,7 @@ function getSource(stack) {
6666
if (stackData === null) return '';
6767
const [, at, filename, lineNumber] = stackData;
6868
const functionName = at.replace(exportsRegex, '');
69-
const relativePath = relative(PWD, filename);
69+
const relativePath = relative(CWD, filename);
7070
return ['<', functionName, '> [', relativePath, ':', lineNumber, ']'].join('');
7171
}
7272

0 commit comments

Comments
 (0)