| 1960 | */ |
| 1961 | export const getAppVersion = async () => { |
| 1962 | const getPackageJsonPath = (): string => { |
| 1963 | const checkPaths = [ |
| 1964 | path.join(__dirname, '..', 'package.json'), |
| 1965 | path.join(__dirname, '..', '..', 'package.json'), |
| 1966 | path.join(__dirname, '..', '..', '..', 'package.json'), |
| 1967 | path.join(__dirname, '..', '..', '..', '..', 'package.json'), |
| 1968 | path.join(__dirname, '..', '..', '..', '..', '..', 'package.json') |
| 1969 | ] |
| 1970 | for (const checkPath of checkPaths) { |
| 1971 | if (fs.existsSync(checkPath)) { |
| 1972 | return checkPath |
| 1973 | } |
| 1974 | } |
| 1975 | return '' |
| 1976 | } |
| 1977 | |
| 1978 | const packagejsonPath = getPackageJsonPath() |
| 1979 | if (!packagejsonPath) return '' |