MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getCurrentAppPath

Function getCurrentAppPath

packages/core/utils/native-helper.ios.ts:94–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94function getCurrentAppPath(): string {
95 if (!global.__dirname) {
96 global.__dirname = typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname;
97 }
98 const currentDir = global.__dirname;
99 const tnsModulesIndex = currentDir.indexOf('/tns_modules');
100
101 // Module not hosted in ~/tns_modules when bundled. Use current dir.
102 let appPath = currentDir;
103 if (tnsModulesIndex !== -1) {
104 // Strip part after tns_modules to obtain app root
105 appPath = currentDir.substring(0, tnsModulesIndex);
106 }
107
108 return appPath;
109}
110
111function joinPaths(...paths: string[]): string {
112 if (!paths || paths.length === 0) {

Callers 1

openFileAtRootModuleFunction · 0.70

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected