本文整理匯總了TypeScript中monterey-pal.FS.normalize方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FS.normalize方法的具體用法?TypeScript FS.normalize怎麽用?TypeScript FS.normalize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類monterey-pal.FS
的用法示例。
在下文中一共展示了FS.normalize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: tryLocatePackageJSON
async tryLocatePackageJSON(project, p) {
if (await FS.fileExists(p)) {
project.packageJSONPath = FS.normalize(p);
let packageJSON = await this.getPackageJSON(project);
// if the project already has a name then it has just been scaffolded
if (project.name) {
// check if the name of the project is equal to the name mentioned in package.json
if (packageJSON.name !== project.name) {
// if not, update package.json to use the project name and persist this to the filesystem
packageJSON.name = project.name;
await FS.writeFile(project.packageJSONPath, JSON.stringify(packageJSON, null, 4));
}
}
project.name = packageJSON.name;
return true;
}
return false;
}