Skip to content

Commit 9abd0f1

Browse files
committed
Fix .jar file after specifying versions
1 parent ae82c8a commit 9abd0f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ task fatJarCore(type: Jar) {
6262
task fatJarLauncher() {
6363
doLast {
6464
File launcherFile = new File(rootProject.buildDir, "libs/kaifu2x")
65-
launcherFile.write('java -jar $0-all.jar $*')
65+
launcherFile.write("java -jar \$0-all-${version}.jar \$*")
6666
Files.setPosixFilePermissions(launcherFile.toPath(), Files.getPosixFilePermissions(launcherFile.toPath()) + [PosixFilePermission.OWNER_EXECUTE, PosixFilePermission.GROUP_EXECUTE, PosixFilePermission.OTHERS_EXECUTE].toSet())
6767
}
6868
}
@@ -73,7 +73,7 @@ task fatJar(dependsOn: [fatJarCore, fatJarLauncher]) {
7373
task installCli(dependsOn: fatJar) {
7474
doLast {
7575
Files.copy(new File(rootProject.buildDir, "libs/kaifu2x").toPath(), new File("/usr/local/bin/kaifu2x").toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES)
76-
Files.copy(new File(rootProject.buildDir, "libs/kaifu2x-all.jar").toPath(), new File("/usr/local/bin/kaifu2x-all.jar").toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES)
76+
Files.copy(new File(rootProject.buildDir, "libs/kaifu2x-all-${version}.jar").toPath(), new File("/usr/local/bin/kaifu2x-all-${version}.jar").toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES)
7777
}
7878
}
7979

0 commit comments

Comments
 (0)