| 1951 | */ |
| 1952 | export const getAppVersion = async () => { |
| 1953 | const getPackageJsonPath = (): string => { |
| 1954 | const checkPaths = [ |
| 1955 | path.join(__dirname, '..', 'package.json'), |
| 1956 | path.join(__dirname, '..', '..', 'package.json'), |
| 1957 | path.join(__dirname, '..', '..', '..', 'package.json'), |
| 1958 | path.join(__dirname, '..', '..', '..', '..', 'package.json'), |
| 1959 | path.join(__dirname, '..', '..', '..', '..', '..', 'package.json') |
| 1960 | ] |
| 1961 | for (const checkPath of checkPaths) { |
| 1962 | if (fs.existsSync(checkPath)) { |
| 1963 | return checkPath |
| 1964 | } |
| 1965 | } |
| 1966 | return '' |
| 1967 | } |
| 1968 | |
| 1969 | const packagejsonPath = getPackageJsonPath() |
| 1970 | if (!packagejsonPath) return '' |