decova-gotcha
Version:
It's my personal trial for automating daunting tasks
32 lines • 1.54 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"));
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().xAny(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() {
}
}
exports.WorkspaceAugmenter = WorkspaceAugmenter;
//# sourceMappingURL=WorkspaceAugmenter.js.map