fix(absolute pathing): add functions for easily getting absolute paths
This commit is contained in:
parent
6646f173c6
commit
d6eb54d21c
@ -69,7 +69,7 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
// INSTANCE
|
||||
// ========
|
||||
/**
|
||||
* the full path of the file on disk
|
||||
* the relative path of the file
|
||||
*/
|
||||
@plugins.smartjson.foldDec()
|
||||
public path: string;
|
||||
@ -116,6 +116,14 @@ export class Smartfile extends plugins.smartjson.Smartjson {
|
||||
this.base = optionsArg.base;
|
||||
}
|
||||
|
||||
public getAbsolutePath () {
|
||||
return plugins.path.join(this.base, this.path);
|
||||
}
|
||||
|
||||
public getAbsoluteParsedPath() {
|
||||
return plugins.path.parse(this.getAbsolutePath());
|
||||
}
|
||||
|
||||
/**
|
||||
* set contents from string
|
||||
* @param contentString
|
||||
|
Loading…
Reference in New Issue
Block a user