Warn and make Gradle Wrapper script executable

Instead of failing the build, detect a non-executable wrapper file
and set the executable bit.

Fixes #17
This commit is contained in:
daz
2024-02-08 21:58:12 -07:00
parent dfd22334ff
commit 2f23d645f2
10 changed files with 386 additions and 3 deletions

View File

@@ -140722,6 +140722,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.gradleWrapperScript = exports.installScriptFilename = exports.wrapperScriptFilename = void 0;
const core = __importStar(__nccwpck_require__(42186));
const path = __importStar(__nccwpck_require__(71017));
const fs_1 = __importDefault(__nccwpck_require__(57147));
const IS_WINDOWS = process.platform === 'win32';
@@ -140755,7 +140756,8 @@ function verifyIsExecutableScript(toExecute) {
fs_1.default.accessSync(toExecute, fs_1.default.constants.X_OK);
}
catch (err) {
throw new Error(`Gradle script '${toExecute}' is not executable.`);
core.warning(`Gradle wrapper script '${toExecute}' is not executable. Action will set executable permission and continue.`);
fs_1.default.chmodSync(toExecute, '755');
}
}

File diff suppressed because one or more lines are too long