UNPKG

wv-gotcha

Version:

![](https://raw.githubusercontent.com/wV-software/icons/main/Wv/Product%20Icon/wv_128x128.png) wv-local-service-bus # Purpose To accumulate your walkthroughs to accomplish your common tasks with less effort.

57 lines 3.6 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.WTR_Fun_GrapWallpapers = void 0; const wv_filesystem_1 = require("wv-filesystem"); const Dialog_1 = require("../Dialog"); const _RegisterWalkthrough_1 = require("./_Foundation/_RegisterWalkthrough"); const fs = require('fs'); const os = require('os'); const path = require('path'); let WTR_Fun_GrapWallpapers = class WTR_Fun_GrapWallpapers { constructor() { this.text = 'Fun >> Grap wallpapers'; } execAsync() { return __awaiter(this, void 0, void 0, function* () { const tempDirPath = path.join(wv_filesystem_1.DirectoryInfo.special.tempDir.fullName, 'wv-gotcha/grapped-wallpapers'); const userHomeDir = wv_filesystem_1.DirectoryInfo.special.userProfile; const tempDir = new wv_filesystem_1.DirectoryInfo(tempDirPath); tempDir.ensure(); Dialog_1.Dialog.exec(`explorer \"${tempDir.fullName.xReplaceAll('/', '\\')}\"`); const spotListDirPath = wv_filesystem_1.Path.join(userHomeDir.fullName, `AppData/Local/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets`); const bingImagePath = wv_filesystem_1.Path.join(userHomeDir.fullName, `/AppData/Roaming/Microsoft/Windows/Themes/TranscodedWallpaper`); const spotLightFiles = new wv_filesystem_1.DirectoryInfo(spotListDirPath).getFiles().xWhere(f => f.fileSize > 100000); for (let f of spotLightFiles) { f.copyTo(`${tempDir.fullName}/${f.name}.jpeg`); } const bingImageFile = new wv_filesystem_1.FileInfo(bingImagePath); if (bingImageFile.exists() === false) { Dialog_1.Dialog.warning(`Bing image file doesn\'t exist @${bingImagePath}`); } else { bingImageFile.copyTo(`${tempDir.fullName}/${bingImageFile.name}.jpg`); } yield Dialog_1.Dialog.instructAsync('Please wait the grapped in folder to open in the explorer'); }); } }; WTR_Fun_GrapWallpapers = __decorate([ (0, _RegisterWalkthrough_1.RegisterWalkthrough)() ], WTR_Fun_GrapWallpapers); exports.WTR_Fun_GrapWallpapers = WTR_Fun_GrapWallpapers; //# sourceMappingURL=WTR_Fun_GrapWallpapers.js.map