Skip to content

Commit

Permalink
Fix: Keep looping for parent inodes in the current directory
Browse files Browse the repository at this point in the history
The tricky dirname util doesn't give the parent directory when the
argument is the current directory ('.'). This resulted in infinite
loops if the current directory happened to be scanned.
Could happen with partially incorrect configurations.
  • Loading branch information
deribaucourt committed Dec 8, 2023
1 parent 4b5f250 commit e040aae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/driver/BitBakeProjectScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class BitBakeProjectScanner {
}

private async getContainerParentInodes (filepath: string): Promise<number[]> {
const commandResult = await this.executeBitBakeCommand(`f=${filepath}; while [[ $f != / ]]; do stat -c %i $f; f=$(dirname "$f"); done;`)
const commandResult = await this.executeBitBakeCommand(`f=${filepath}; while [[ $f != / ]]; do stat -c %i $f; f=$(realpath $(dirname "$f")); done;`)
const stdout = commandResult.stdout.toString().trim()
const regex = /^\d+$/gm
const matches = stdout.match(regex)
Expand Down

0 comments on commit e040aae

Please sign in to comment.