Skip to content

Commit

Permalink
[precommit hook] resolve relative file paths from cwd (elastic#52157)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored and timductive committed Dec 16, 2019
1 parent 42b0305 commit 4c16185
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 4c16185

Please sign in to comment.