{"version":3,"file":"get_gradlew_path.js","sourceRoot":"","sources":["../../src/parser_scripts/get_gradlew_path.ts"],"names":[],"mappings":";;;;;AAKA,oDASC;AAGD,wEAEC;AAnBD,+CAAiD;AACjD,6DAAsD;AACtD,gDAAuB;AAEvB,oDAAoD;AAC7C,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,iBAA0B;IAChF,MAAM,UAAU,GAAG,iBAAiB,IAAI,IAAA,oCAAe,EAAC,GAAG,EAAE,SAAS,CAAC,CAAA;IACvE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,IAAA,uBAAa,EACX,2JAA2J,CAC5J,CAAA;IACH,CAAC;IAED,OAAO,cAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AACjC,CAAC;AAED,kCAAkC;AAClC,SAAgB,8BAA8B,CAAC,gBAAwB;IACrE,OAAO,gBAAgB,KAAK,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;AACxF,CAAC","sourcesContent":["import { exitWithError } from '../common/logging'\nimport { getFileIfExists } from './get_file_if_exists'\nimport path from 'path'\n\n// Get the enclosing directory of the gradle wrapper\nexport async function getGradleWrapperPath(cwd: string, gradleWrapperPath?: string) {\n const gradlePath = gradleWrapperPath || getFileIfExists(cwd, 'gradlew')\n if (!gradlePath) {\n exitWithError(\n 'Could not find the location of the gradlew in your project. You can specify the location of your gradlew file with the `gradleWrapperPath` config option.',\n )\n }\n\n return path.dirname(gradlePath)\n}\n\n// Get the path for the executable\nexport function getGradleWrapperExecutablePath(gradleWrapperDir: string) {\n return gradleWrapperDir === '.' ? './gradlew' : path.join(gradleWrapperDir, 'gradlew')\n}\n"]}