mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
refactor: reuse satisfies function in condition
This commit is contained in:
1 parent
3656868b66
commit
6e804f0ed4
1 file changed
+2
-2
@@ -5,7 +5,7 @@ import { StageException } from './schema/exception'
|
|||||||
export class Stage {
|
export class Stage {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
private condition: Condition
|
public readonly condition: Condition
|
||||||
private requirements: string[]
|
private requirements: string[]
|
||||||
public readonly exceptions: StageException[]
|
public readonly exceptions: StageException[]
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ export class Stage {
|
|||||||
command: ICommand,
|
command: ICommand,
|
||||||
checker: IFileExistenceChecker
|
checker: IFileExistenceChecker
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
return this.condition.match(command) && this.condition.check(checker)
|
return this.condition.satisfies(command, checker)
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkRequirements(completed: string[]): boolean {
|
private checkRequirements(completed: string[]): boolean {
|
||||||
|
|||||||
Reference in new issue
Block a user