UNPKG

549 BJavaScriptView Raw
1#! /usr/bin/env node
2
3const shell = require('shelljs')
4const { generateTestIndex } = require('../lib/story-index-generator')
5const { PACKAGE_JSON_CONFIG_KEY } = require('../lib/config')
6
7const either = generateTestIndex()
8if (either.isLeft()) {
9 const error = either.left()
10 shell.echo(`Error: ${error.message}`)
11 if (error.code === 'ENOENT') {
12 shell.echo(`Check value in package.json -> ${PACKAGE_JSON_CONFIG_KEY} -> pathToTestIndex`)
13 }
14 shell.exit(1)
15} else {
16 shell.echo(`Story files found: ${either.right().length}`)
17 shell.exit()
18}