mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: add stage condition checks
This commit is contained in:
1 parent
77fe2d37b3
commit
5bea2ea78c
3 files changed
+60
-13
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { IStage, ICommand } from './types'
|
||||
import { IStage, ICommand, IFileExistenceChecker } from './types'
|
||||
import { Condition } from './condition/Condition'
|
||||
|
||||
export class Stage {
|
||||
@@ -12,7 +12,10 @@ export class Stage {
|
||||
this.condition = new Condition(condition)
|
||||
}
|
||||
|
||||
satisfies(command: ICommand): boolean {
|
||||
return this.condition.match(command)
|
||||
async satisfies(
|
||||
command: ICommand,
|
||||
checker: IFileExistenceChecker
|
||||
): Promise<boolean> {
|
||||
return this.condition.match(command) && this.condition.check(checker)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user