-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.js
More file actions
30 lines (26 loc) · 746 Bytes
/
common.js
File metadata and controls
30 lines (26 loc) · 746 Bytes
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
const { exec } = require("child_process");
const dustInitDirectoryName = '.duts'
const seperator = '\0'
const lineSeperator = '\n'
function execCmd(cmd) {
console.log(cmd);
exec(cmd)
}
function makeDutsfilePath(file) {
const extensionRegex = /\.[0-9a-z]+$/i
var dutsfileName = ''
if (file.match(extensionRegex) === null) {
dutsfileName = file + '_duts'
} else {
dutsfileName = file.replace(extensionRegex, file.match(extensionRegex)[0] + '_duts')
}
const dustfilePath = `${dustInitDirectoryName}/${dutsfileName}`
return dustfilePath
}
module.exports = {
execCmd: execCmd,
makeDutsfilePath: makeDutsfilePath,
dustInitDirectoryName: dustInitDirectoryName,
seperator: seperator,
lineSeperator: lineSeperator
}