/
githubmirror
/
gpt-runner
Обзор
Документация
Войти
/
githubmirror
/
gpt-runner
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/gpt-runner-cli/src/watcher.ts
23 строки
612 B
JinmingYang
feat(gpt-runner-cli): complete cli
07 июн 2023, 20:51
07 июн 2023, 20:51
7e02171
Код
Авторство
О чём код?
import type { FSWatcher } from 'chokidar' import type { CliOptions } from './types' // TODO: move into core let watcher: FSWatcher export async function getWatcher(options?: CliOptions) { // test case entry without options if (watcher && !options) return watcher const { watch } = await import('chokidar') const ignored = ['**/{.git,node_modules}/**'] // cli may create multiple watchers const newWatcher = watch([] as string[], { ignoreInitial: true, ignorePermissionErrors: true, ignored, cwd: options?.cwd || process.cwd(), }) watcher = newWatcher return newWatcher }