1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-14 11:23:17 +02:00
pigallery2/backend/ProjectPath.ts
2016-12-26 23:36:38 +01:00

20 lines
753 B
TypeScript

import * as path from "path";
import {Config} from "./config/Config";
class ProjectPathClass {
public Root: string;
public ImageFolder: string;
public ThumbnailFolder: string;
isAbsolutePath(pathStr: string) {
return path.resolve(pathStr) === path.normalize(pathStr);
}
constructor() {
this.Root = path.join(__dirname, "/../");
this.ImageFolder = this.isAbsolutePath(Config.Server.imagesFolder) ? Config.Server.imagesFolder : path.join(this.Root, Config.Server.imagesFolder);
this.ThumbnailFolder = this.isAbsolutePath(Config.Server.thumbnailFolder) ? Config.Server.thumbnailFolder : path.join(this.Root, Config.Server.thumbnailFolder);
}
}
export let ProjectPath = new ProjectPathClass();