UNPKG

t-comm

Version:

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

31 lines (28 loc) 1.01 kB
import path__default from 'path'; import { getSubmodulePathList } from '../git/submodule.mjs'; import { execCommand } from '../node/node-command.mjs'; import 'fs'; import '../fs/fs.mjs'; import '@babel/runtime/helpers/typeof'; function getSubmodulePathStr(file) { var submodules = getSubmodulePathList(file); var str = "\n".concat(submodules.map(function (item) { return "".concat(item, "/*"); }).join('\n')); return str; } function ignoreSubmoduleInESLint(root) { if (root === void 0) { root = process.cwd(); } var str = getSubmodulePathStr(path__default.resolve(root, '.gitmodules')); execCommand("echo \"".concat(str, "\" >> .eslintignore"), root, 'inherit'); } function ignoreSubmoduleInStyleLint(root) { if (root === void 0) { root = process.cwd(); } var str = getSubmodulePathStr(path__default.resolve(root, '.gitmodules')); execCommand("echo \"".concat(str, "\" >> .stylelintignore"), root, 'inherit'); } export { ignoreSubmoduleInESLint, ignoreSubmoduleInStyleLint };