Skip to content

Commit 35c0877

Browse files
committed
Don't set any files hidden unless on windows
1 parent b09ed94 commit 35c0877

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
java-version: 17
1717
distribution: 'zulu'
1818
check-latest: true
19-
- name: Build Changelog
20-
id: build_changelog
21-
uses: mikepenz/release-changelog-builder-action@v1
22-
with:
23-
commitMode: true
24-
token: ${{ github.token }}
19+
# - name: Build Changelog
20+
# id: build_changelog
21+
# uses: mikepenz/release-changelog-builder-action@v1
22+
# with:
23+
# commitMode: true
24+
# token: ${{ github.token }}
2525
- name: Setup ENV
2626
run: echo "TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
2727
- name: Grant execute permission for gradlew
@@ -38,6 +38,7 @@ jobs:
3838
token: ${{ github.token }}
3939
tag: ${{ github.ref }}
4040
name: Release ${{ env.TAG }}
41-
body: ${{steps.build_changelog.outputs.changelog}}
41+
# body: ${{steps.build_changelog.outputs.changelog}}
4242
artifactErrorsFailBuild: true
4343
artifacts: 'build/libs/**.jar'
44+
generateReleaseNotes: true

src/launcher/java/com/mcmoddev/relauncher/Main.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ public static DiscordIntegration getDiscordIntegration() {
159159
public static void copyAgent(JarUpdater updater) throws IOException {
160160
final var agentPath = updater.getAgentPath();
161161
Files.copy(updater.getAgentResource(), agentPath, StandardCopyOption.REPLACE_EXISTING);
162-
final var atView = Files.getFileAttributeView(agentPath, DosFileAttributeView.class);
163-
atView.setHidden(true);
162+
if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win")) {
163+
final var atView = Files.getFileAttributeView(agentPath, DosFileAttributeView.class);
164+
atView.setHidden(true);
165+
}
164166
}
165167

166168
public static void selfUpdate(String tagName) throws Exception {
@@ -200,8 +202,10 @@ public static void selfUpdate(String tagName) throws Exception {
200202

201203
final var selfUpdateJarPath = RELAUNCHER_DIR.resolve("selfupdate.jar").toAbsolutePath();
202204
Files.copy(Objects.requireNonNull(Main.class.getResourceAsStream("/relauncher-selfupdate.zip")), selfUpdateJarPath, StandardCopyOption.REPLACE_EXISTING);
203-
final var atView = Files.getFileAttributeView(selfUpdateJarPath, DosFileAttributeView.class);
204-
atView.setHidden(true);
205+
if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win")) {
206+
final var atView = Files.getFileAttributeView(selfUpdateJarPath, DosFileAttributeView.class);
207+
atView.setHidden(true);
208+
}
205209

206210
final var process = updater.getProcess();
207211
if (process != null) {

src/launcher/java/com/mcmoddev/relauncher/selfupdate/SelfUpdate.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ public static List<String> resolveScript(String os, String script) throws IOExce
104104
cmd = List.of("sh", path.toString());
105105
}
106106
Files.copy(new ByteArrayInputStream(scriptFull.getBytes(StandardCharsets.UTF_8)), path, StandardCopyOption.REPLACE_EXISTING);
107-
final var atView = Files.getFileAttributeView(path, DosFileAttributeView.class);
108-
atView.setHidden(true);
107+
if (os.contains("win")) {
108+
final var atView = Files.getFileAttributeView(path, DosFileAttributeView.class);
109+
atView.setHidden(true);
110+
}
109111
return cmd;
110112
}
111113

0 commit comments

Comments
 (0)