Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Nov 16, 2024
1 parent d1bdcd7 commit 9fd858b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Git checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
version: '21.3.0'
java-version: '17'

- name: Verify Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Publish
run: ./gradlew publish
env:
Expand All @@ -30,7 +27,7 @@ jobs:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: modulefs
path: modulefs/build/libs
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion modulefs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'signing'
}

version '0.1.5'
version '0.1.6'
group 'io.xpipe'
archivesBaseName = 'modulefs'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ static Optional<JarModuleFileSystem> create(
if (openFsCounts.containsKey(modFilePath)) {
jarFs = FileSystems.getFileSystem(fsUri);
} else {
boolean isWritable = modFilePath.toFile().canWrite();
if (isWritable && !modFilePath.toFile().setWritable(false)) {
throw new IOException("Unable to make file " + modFilePath + " not writable");
}
jarFs = FileSystems.newFileSystem(fsUri, Map.of());
if (isWritable) {
if (!modFilePath.toFile().setWritable(true)) {
throw new IOException("Unable to make file " + modFilePath + " writable");
}
try {
var m = jarFs.getClass().getDeclaredMethod("setReadOnly");
m.invoke(jarFs);
} catch (IllegalAccessException ignored) {
} catch (Exception e) {
throw new RuntimeException("Unable to make file " + modFilePath + " read-only", e);
}
}
return Optional.of(new JarModuleFileSystem(module, jarFs.getPath("/"), modFilePath, provider));
Expand Down

0 comments on commit 9fd858b

Please sign in to comment.