mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
chore: clean up unused code
This commit is contained in:
@ -19,9 +19,7 @@ interface IPackageJson {
|
||||
* Utility function to get the contents of the project package.json
|
||||
*/
|
||||
export function getPackageJson() {
|
||||
return require(
|
||||
getProjectFilePath('package.json')
|
||||
) as IPackageJson;
|
||||
return require(getProjectFilePath('package.json')) as IPackageJson;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -31,3 +29,22 @@ export function getPackageJson() {
|
||||
export function getProjectFilePath(filePath: string): string {
|
||||
return resolve(getProjectRootPath(), filePath);
|
||||
}
|
||||
|
||||
// unused helper, but keeping it here as we may need it
|
||||
// todo: remove if unused for next few releases
|
||||
// function findFile(fileName, currentDir): string | null {
|
||||
// // console.log(`findFile(${fileName}, ${currentDir})`)
|
||||
// const path = resolve(currentDir, fileName);
|
||||
//
|
||||
// if (existsSync(path)) {
|
||||
// return path;
|
||||
// }
|
||||
//
|
||||
// // bail if we reached the root dir
|
||||
// if (currentDir === resolve('/')) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// // traverse to the parent folder
|
||||
// return findFile(fileName, resolve(currentDir, '..'));
|
||||
// }
|
||||
|
Reference in New Issue
Block a user