Adds ${filePath} support to status file formatting

This commit is contained in:
Eric Amodio
2017-08-27 03:58:00 -04:00
parent a255eea949
commit ca089777db
2 changed files with 11 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import * as path from 'path';
export interface IStatusFormatOptions extends IFormatOptions {
tokenOptions?: {
file?: Strings.ITokenOptions;
filePath?: Strings.ITokenOptions;
path?: Strings.ITokenOptions;
};
}
@@ -18,6 +19,11 @@ export class StatusFileFormatter extends Formatter<IGitStatusFile, IStatusFormat
return this._padOrTruncate(file, this._options.tokenOptions!.file);
}
get filePath() {
const filePath = GitStatusFile.getFormattedPath(this._item);
return this._padOrTruncate(filePath, this._options.tokenOptions!.filePath);
}
get path() {
const directory = GitStatusFile.getFormattedDirectory(this._item, false);
return this._padOrTruncate(directory, this._options.tokenOptions!.file);