Skip to content
Snippets Groups Projects
Unverified Commit cdcb455d authored by Johannes Feichtner's avatar Johannes Feichtner Committed by GitHub
Browse files

fix(manager/gradle-wrapper): issue a warning in case gradlew isn't executable (#18349)

parent 5559b535
No related branches found
No related tags found
No related merge requests found
...@@ -62,7 +62,7 @@ describe('modules/manager/gradle-wrapper/util', () => { ...@@ -62,7 +62,7 @@ describe('modules/manager/gradle-wrapper/util', () => {
describe('prepareGradleCommand', () => { describe('prepareGradleCommand', () => {
it('works', async () => { it('works', async () => {
platform.mockReturnValueOnce('linux'); platform.mockReturnValue('linux');
fs.statLocalFile.mockResolvedValue( fs.statLocalFile.mockResolvedValue(
partial<Stats>({ partial<Stats>({
isFile: () => true, isFile: () => true,
......
...@@ -27,7 +27,8 @@ export async function prepareGradleCommand( ...@@ -27,7 +27,8 @@ export async function prepareGradleCommand(
const gradlewStat = await statLocalFile(gradlewFile); const gradlewStat = await statLocalFile(gradlewFile);
if (gradlewStat?.isFile() === true) { if (gradlewStat?.isFile() === true) {
// if the file is not executable by others // if the file is not executable by others
if ((gradlewStat.mode & 0o1) === 0) { if (os.platform() !== 'win32' && (gradlewStat.mode & 0o1) === 0) {
logger.warn('Gradle wrapper is missing the executable bit');
// add the execution permission to the owner, group and others // add the execution permission to the owner, group and others
await chmodLocalFile(gradlewFile, gradlewStat.mode | 0o111); await chmodLocalFile(gradlewFile, gradlewStat.mode | 0o111);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment