poyka
Version:
A framework for interactively creating, extending and maintaining web application as never easier before while doing it in elegant design patterns.
37 lines • 1.79 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkspaceAugmenter = void 0;
const decova_filesystem_1 = require("decova-filesystem");
const path_1 = __importDefault(require("path"));
const PackMan_1 = require("./PackMan");
class WorkspaceAugmenter {
static get VsCodeDir() {
return new decova_filesystem_1.DirectoryInfo(path_1.default.join(decova_filesystem_1.DirectoryInfo.Current.FullName, '.vscode'));
}
static get PoykaWorkSpace() {
const thisJsCodeFile = new decova_filesystem_1.FileInfo(__filename);
return thisJsCodeFile.Directory.FindAncestor(d => d.GetFiles().Any(f => f.Name.toLowerCase() == 'package.json'));
}
static EnsureWholeFileContentPublished(...fileNames) {
for (let fileName of fileNames) {
if (this.VsCodeDir.Exists() === false)
return;
const destinationPath = path_1.default.join(this.VsCodeDir.FullName, fileName);
if (new decova_filesystem_1.FileInfo(destinationPath).Exists())
return;
const sourceFile = new decova_filesystem_1.FileInfo(path_1.default.join(this.PoykaWorkSpace.FullName, 'contents', fileName));
sourceFile.CopyTo(destinationPath);
}
}
static EnsureTasksPublished() {
}
static EnsureWorkspaceAugmented() {
this.EnsureWholeFileContentPublished(PackMan_1.CommonFileName.decovaSettings, PackMan_1.CommonFileName.decovaSnippets);
this.EnsureTasksPublished();
}
}
exports.WorkspaceAugmenter = WorkspaceAugmenter;
//# sourceMappingURL=WorkspaceAugmenter.js.map