summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorevgeny <me@ch1p.com>2017-06-17 02:51:02 +0300
committerevgeny <me@ch1p.com>2017-06-17 02:51:02 +0300
commit10a4a51a747283c529af5029253968f5f36119ad (patch)
treee960d72aceb2da8ab4f550657c1b0d6360a04c57
parent61e326656ca7f4c62ee43cc330f97886cf6c5645 (diff)
add escapeShellArg func
-rw-r--r--index.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/index.js b/index.js
index ba4ac3d..7c42f1d 100644
--- a/index.js
+++ b/index.js
@@ -1,2 +1,15 @@
'use strict'
-module.exports = require('./build/Release/winutils.node')
+
+const bin = require('./build/Release/winutils.node')
+
+module.exports = {
+ escapeShellArg(arg) {
+ arg = arg.replace(/["%!]/g, ' ')
+ return '"' + arg + '"'
+ },
+
+ deelevate: bin.deelevate,
+ elevate: bin.elevate,
+ getSystem32Path: bin.getSystem32Path,
+ isUserAdmin: bin.isUserAdmin
+}