@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
1 lines • 993 B
Source Map (JSON)
{"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/utils/file-replacement.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,qBAAqB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,iBAS3F","file":"file-replacement.d.ts","sourcesContent":["import * as fs from 'fs';\r\nimport { Logger } from './logger';\r\n\r\n/**\r\n * the file replacement function.\r\n * @param sourceContentFilePath the source file path.\r\n * @param writeToFilePath the write to file path.\r\n */\r\nexport async function fileReplacement(sourceContentFilePath: string, writeToFilePath: string) {\r\n const prefix = 'fileReplacement';\r\n try {\r\n const data = await fs.promises.readFile(sourceContentFilePath, 'utf-8');\r\n await fs.promises.writeFile(writeToFilePath, data, 'utf-8');\r\n Logger.log(`File \"${sourceContentFilePath}\" replaced with \"${writeToFilePath}\".`, prefix);\r\n } catch (error) {\r\n Logger.error(`Error: ${error.message}`);\r\n }\r\n}\r\n"]}