Skip to content

Commit

Permalink
Merge pull request #74 from friederbluemle/fix-du-macos
Browse files Browse the repository at this point in the history
Fix du parameters on macOS
  • Loading branch information
NyaGarcia committed May 20, 2020
2 parents e4500b3 + 2566e9a commit d3b2005
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/linux-files.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export class LinuxFilesService extends FileService {
}

getFolderSize(path: string): Observable<{}> {
const du = spawn('du', ['-s', '-b', path]);
const du = spawn('du', ['-sk', path]);
const cut = spawn('cut', ['-f', '1']);

du.stdout.pipe(cut.stdin);

return this.streamService
.getStream(cut)
.pipe(map(size => super.convertBytesToKB(+size)));
.pipe(map(size => +size));
}

listDir(params: IListDirParams): Observable<Buffer> {
Expand Down

0 comments on commit d3b2005

Please sign in to comment.