UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

18 lines (15 loc) 513 B
import { readFileSync } from '../fs/fs.mjs'; import { getFs } from '../nodejs/fs.mjs'; import '../nodejs/crypto.mjs'; import '../nodejs/os.mjs'; function getSubmodulePathList() { var file = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.gitmodules'; if (!getFs().existsSync(file)) { return []; } var content = readFileSync(file); var pathReg = /(?<=path\s*=\s*)([^\s]+)/g; var match = content.match(pathReg) || []; return match || []; } export { getSubmodulePathList };