Skip to content

Commit

Permalink
[precommit hook] resolve relative file paths from cwd (#52157)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored Dec 5, 2019
1 parent 3c55e55 commit 8122b8b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/dev/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@

import { dirname, extname, join, relative, resolve, sep } from 'path';

import { REPO_ROOT } from './constants';

export class File {
private path: string;
private relativePath: string;
private ext: string;

constructor(path: string) {
this.path = resolve(path);
this.relativePath = relative(REPO_ROOT, this.path);
this.relativePath = relative(process.cwd(), this.path);
this.ext = extname(this.path);
}

Expand Down

0 comments on commit 8122b8b

Please sign in to comment.