Skip to content

Commit 8e4a856

Browse files
timilirisclaude
andcommitted
Fix gradlew CRLF line endings causing Linux/macOS failures
- Convert bundled gradlew to Unix LF line endings - Add runtime conversion in HytaleModuleBuilder to ensure LF regardless of source - Fixes "bash: ./gradlew: cannot execute: required file not found" error Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 93663f4 commit 8e4a856

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Keep Unix line endings for shell scripts
2+
*.sh text eol=lf
3+
src/main/resources/gradle-wrapper/gradlew text eol=lf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
.qodana
77
build
88
.claude/
9+
local.properties

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## [Unreleased]
44

5+
## [1.4.2] - 2026-02-06
6+
7+
### Fixed
8+
9+
- **Linux/macOS: Gradle wrapper corrupted (CRLF line endings)**: Fixed gradlew script generated by project wizard
10+
- Source file had Windows CRLF line endings causing `bash: ./gradlew: cannot execute: required file not found`
11+
- Converted bundled gradlew to Unix LF line endings
12+
- Added runtime conversion to ensure LF endings regardless of source
13+
514
## [1.4.1] - 2026-02-06
615

716
### Fixed
@@ -210,7 +219,8 @@
210219
- Supports IntelliJ IDEA 2024.3+
211220
- Requires Java 25 for Hytale development
212221

213-
[Unreleased]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.4.1...HEAD
222+
[Unreleased]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.4.2...HEAD
223+
[1.4.2]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.4.1...v1.4.2
214224
[1.4.1]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.4.0...v1.4.1
215225
[1.4.0]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.9...v1.4.0
216226
[1.3.9]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.7...v1.3.9

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = com.hytaledocs.hytale
44
pluginName = Hytale Development Tools
55
pluginRepositoryUrl = https://github.com/HytaleDocs/hytale-intellij-plugin
66
# SemVer format -> https://semver.org
7-
pluginVersion = 1.4.1
7+
pluginVersion = 1.4.2
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 242

src/main/kotlin/com/hytaledocs/intellij/wizard/HytaleModuleBuilder.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,12 @@ class HytaleModuleBuilder : ModuleBuilder() {
679679
}
680680
}
681681

682-
// Copy gradlew script (Unix)
682+
// Copy gradlew script (Unix) - ensure LF line endings
683683
javaClass.getResourceAsStream("/gradle-wrapper/gradlew")?.use { input ->
684684
val gradlewFile = File(basePath, "gradlew")
685-
gradlewFile.outputStream().use { output ->
686-
input.copyTo(output)
687-
}
685+
// Read content and ensure Unix line endings (LF only, no CRLF)
686+
val content = input.bufferedReader().readText().replace("\r\n", "\n").replace("\r", "\n")
687+
gradlewFile.writeText(content)
688688
gradlewFile.setExecutable(true)
689689
}
690690

0 commit comments

Comments
 (0)