Skip to content

Commit 64b47d3

Browse files
committed
f
1 parent 3c948fd commit 64b47d3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/fs.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ export type WatchDirOptions = {
7171
iterOnLinux?: boolean
7272
}
7373

74-
function watchDir(dir: string, cb: WatchDirHandler): void
75-
function watchDir(dir: string, options: WatchDirOptions, cb: WatchDirHandler): void
74+
function watchDir(dir: string, cb: WatchDirHandler): _fs.FSWatcher | _fs.FSWatcher[]
75+
function watchDir(dir: string, options: WatchDirOptions, cb: WatchDirHandler): _fs.FSWatcher | _fs.FSWatcher[]
7676
function watchDir(
7777
dir: string,
7878
options?: WatchDirOptions | WatchDirHandler,
7979
cb?: WatchDirHandler,
80-
): void {
80+
): _fs.FSWatcher | _fs.FSWatcher[] {
8181
if (Is.fn(options)) {
8282
cb = options as any
8383
options = void 0
@@ -92,9 +92,10 @@ function watchDir(
9292
cb = cb && debounce(cb, options.threshold)
9393
}
9494
if (process.platform === 'linux' && options.iterOnLinux) {
95+
let watches:_fs.FSWatcher[] = []
9596
// tslint:disable-next-line:no-floating-promises
9697
fsExtra.iter(dir, (file) => {
97-
_fs.watch(
98+
let w=_fs.watch(
9899
file,
99100
{
100101
recursive: false,
@@ -103,9 +104,11 @@ function watchDir(
103104
},
104105
cb,
105106
)
107+
watches.push(w)
106108
})
109+
return watches
107110
} else {
108-
_fs.watch(dir, { recursive: true, persistent: options.persistent }, cb)
111+
return _fs.watch(dir, { recursive: true, persistent: options.persistent }, cb)
109112
}
110113
}
111114

src/logger.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function makeLogger(level: LogLevels, logger: Logger) {
3939
time: new Date(),
4040
formatedTime: time,
4141
message: stripAnsi(message),
42+
coloredMessage: message,
4243
levelNum,
4344
filterLevelNum,
4445
args,
@@ -51,6 +52,7 @@ export interface ILogInfo {
5152
time: Date
5253
formatedTime: string
5354
message: string
55+
coloredMessage: string
5456
levelNum: number
5557
args: any[]
5658
filterLevelNum: number

src/task-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface GlobalOptions {
1818
loading?: boolean
1919
indent?: number
2020
/**
21-
* @description Whether task options only allow defined options, default false
21+
* Whether task options only allow defined options, default false
2222
* @default false
2323
*/
2424
strict?: boolean

0 commit comments

Comments
 (0)