-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsudo-prompt+9.2.1.patch
39 lines (37 loc) · 970 Bytes
/
sudo-prompt+9.2.1.patch
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
diff --git a/node_modules/sudo-prompt/index.js b/node_modules/sudo-prompt/index.js
index acfd41b..750a0fc 100644
--- a/node_modules/sudo-prompt/index.js
+++ b/node_modules/sudo-prompt/index.js
@@ -1,12 +1,17 @@
-var Node = {
- child: require('child_process'),
- crypto: require('crypto'),
- fs: require('fs'),
- os: require('os'),
- path: require('path'),
- process: process,
- util: require('util')
-};
+var Node;
+
+function initNode() {
+ if (Node) return;
+ Node = {
+ child: require('child_process'),
+ crypto: require('crypto'),
+ fs: require('fs'),
+ os: require('os'),
+ path: require('path'),
+ process: process,
+ util: require('util')
+ };
+}
function Attempt(instance, end) {
var platform = Node.process.platform;
@@ -22,6 +27,7 @@ function EscapeDoubleQuotes(string) {
}
function Exec() {
+ initNode();
if (arguments.length < 1 || arguments.length > 3) {
throw new Error('Wrong number of arguments.');
}