@jdeighan/coffee-utils 4.1.18 → 4.1.19
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/coffee_utils.coffee +12 -0
- package/src/coffee_utils.js +14 -0
package/package.json
CHANGED
package/src/coffee_utils.coffee
CHANGED
@@ -1,12 +1,24 @@
|
|
1
1
|
# coffee_utils.coffee
|
2
2
|
|
3
3
|
import getline from 'readline-sync'
|
4
|
+
import {execSync} from 'child_process'
|
5
|
+
|
4
6
|
import {log} from '@jdeighan/coffee-utils/log'
|
5
7
|
|
6
8
|
export sep_dash = '-'.repeat(42)
|
7
9
|
export sep_eq = '='.repeat(42)
|
8
10
|
`export const undef = undefined`
|
9
11
|
|
12
|
+
# ---------------------------------------------------------------------------
|
13
|
+
# exec - run external commands
|
14
|
+
|
15
|
+
export exec = (cmd) ->
|
16
|
+
|
17
|
+
buffer = execSync cmd, {
|
18
|
+
windowsHide: true
|
19
|
+
}
|
20
|
+
return buffer.toString()
|
21
|
+
|
10
22
|
# ---------------------------------------------------------------------------
|
11
23
|
# pass - do nothing
|
12
24
|
|
package/src/coffee_utils.js
CHANGED
@@ -4,6 +4,10 @@ var commentRegExp;
|
|
4
4
|
|
5
5
|
import getline from 'readline-sync';
|
6
6
|
|
7
|
+
import {
|
8
|
+
execSync
|
9
|
+
} from 'child_process';
|
10
|
+
|
7
11
|
import {
|
8
12
|
log
|
9
13
|
} from '@jdeighan/coffee-utils/log';
|
@@ -14,6 +18,16 @@ export var sep_eq = '='.repeat(42);
|
|
14
18
|
|
15
19
|
export const undef = undefined;
|
16
20
|
|
21
|
+
// ---------------------------------------------------------------------------
|
22
|
+
// exec - run external commands
|
23
|
+
export var exec = function(cmd) {
|
24
|
+
var buffer;
|
25
|
+
buffer = execSync(cmd, {
|
26
|
+
windowsHide: true
|
27
|
+
});
|
28
|
+
return buffer.toString();
|
29
|
+
};
|
30
|
+
|
17
31
|
// ---------------------------------------------------------------------------
|
18
32
|
// pass - do nothing
|
19
33
|
export var pass = function() {};
|