All files / src/commands check.ts

100% Statements 12/12
60% Branches 3/5
100% Functions 2/2
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 311x 1x                   3x           3x     3x 3x   3x 3x 3x   3x 3x    
import { Project, Resource } from '@/internal'
import recursiveExecte from '@/utils/recursive-execte'
 
 
interface CheckOptions {
  showDiff?: boolean
  fold?: boolean
  cwd?: string
  noDeps?: boolean
}
 
export default recursiveExecte(async(options: CheckOptions = {}) => {
  const {
    showDiff = false,
    fold = false,
    cwd = process.cwd(),
    noDeps = false,
  } = options
 
 
  const project = await Project.load(cwd)
  const repo = await project.getTemplateRepo()
 
  const template = await repo.install({ noDeps })
  const resource = new Resource('check', project, template)
  const compiler = await resource.compile()
 
  await compiler.check({ showDiff , fold })
  await compiler.emit('checked')
})