Package: node-tap / 12.0.1+ds-1

0004-Do-not-use-osHomedir.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From f6e351a037b8929db39ac8b2be3740af0bf48979 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 10 Sep 2017 22:59:23 +0200
Subject: Do not use osHomedir

Forwarded: no
---
 bin/run.js             | 3 +--
 lib/stack.js           | 4 ++--
 package.json           | 1 -
 test-legacy/rcfiles.js | 4 ++--
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/bin/run.js b/bin/run.js
index a9ec81d..78ba63b 100755
--- a/bin/run.js
+++ b/bin/run.js
@@ -15,7 +15,6 @@ return nycBin;
 }
 const glob = require('glob')
 const isexe = require('isexe')
-const osHomedir = require('os-homedir')
 const yaml = require('js-yaml')
 const path = require('path')
 const exists = require('fs-exists-cached').sync
@@ -61,7 +60,7 @@ const main = _ => {
   const defaults = constructDefaultArgs()
 
   // parse dotfile
-  const rcFile = process.env.TAP_RCFILE || (osHomedir() + '/.taprc')
+  const rcFile = process.env.TAP_RCFILE || (os.homedir() + '/.taprc')
   const rcOptions = parseRcFile(rcFile)
 
   // supplement defaults with parsed rc options
diff --git a/lib/stack.js b/lib/stack.js
index 5c8e511..f2e7fbc 100644
--- a/lib/stack.js
+++ b/lib/stack.js
@@ -3,7 +3,7 @@ const sourceMapSupport = require('source-map-support')
 const StackUtils = require('stack-utils')
 const path = require('path')
 const tapDir = path.resolve(__dirname, '..')
-const osHomedir = require('os-homedir')
+const os = require('os')
 
 const resc = str =>
   str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')
@@ -16,7 +16,7 @@ const skip = (process.cwd() !== tapDir ||
   +process.env.TAP_DEV_LONGSTACK !== 1
 ? [
     /node_modules[\/\\]tap[\/\\]/,
-    new RegExp(resc(path.resolve(osHomedir(), '.node-spawn-wrap-')) + '.*'),
+    new RegExp(resc(path.resolve(os.homedir(), '.node-spawn-wrap-')) + '.*'),
     new RegExp(resc(tapDir) + '\\b', 'i'),
     new RegExp(resc(require.resolve('function-loop'))),
     new RegExp(resc(path.dirname(require.resolve('bluebird/package.json'))))
diff --git a/package.json b/package.json
index 9bab3fb..0fd5e85 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,6 @@
     "js-yaml": "^3.11.0",
     "minipass": "^2.3.0",
     "mkdirp": "^0.5.1",
-    "os-homedir": "^1.0.2",
     "own-or": "^1.0.0",
     "own-or-env": "^1.0.1",
     "rimraf": "^2.6.2",
diff --git a/test-legacy/rcfiles.js b/test-legacy/rcfiles.js
index 5696b23..bf8592e 100644
--- a/test-legacy/rcfiles.js
+++ b/test-legacy/rcfiles.js
@@ -3,11 +3,11 @@ var t = require('../')
 var spawn = require('child_process').spawn
 var node = process.execPath
 var run = require.resolve('../bin/run.js')
+var os = require('os')
 
 // fake this one in case you have some weird stuff in ~/.taprc
 var path = require('path')
 process.env.HOME = path.resolve(__dirname, 'fixtures')
-var osHomedir = require('os-homedir')
 
 var defaults = {
   grep: [],
@@ -31,7 +31,7 @@ var defaults = {
   jobs: 1,
   lines: 0,
   statements: 0,
-  rcFile: osHomedir() + '/.taprc',
+  rcFile: os.homedir() + '/.taprc',
   outputFile: null
 }