Skip to content

Commit

Permalink
Merge pull request #1979 from freimair/fixBrokenExecutables
Browse files Browse the repository at this point in the history
Fix broken startScripts in $destinationDir/bin dirs
  • Loading branch information
cbeams committed Nov 27, 2018
2 parents ca5ce59 + 2026da0 commit aecfd22
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ configure([project(':desktop'),
into "${rootProject.projectDir}/lib"
}

// edit generated shell scripts such that they expect to be executed in the
// project root dir as opposed to a 'bin' subdirectory
def windowsScriptFile = file("${rootProject.projectDir}/bisq-${applicationName}.bat")
windowsScriptFile.text = windowsScriptFile.text.replace(
'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%')

def unixScriptFile = file("${rootProject.projectDir}/bisq-$applicationName")
unixScriptFile.text = unixScriptFile.text.replace(
'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null')

if (osdetector.os != 'windows')
delete fileTree(dir: rootProject.projectDir, include: 'bisq-*.bat')
else
Expand All @@ -114,18 +124,6 @@ configure([project(':desktop'),
startScripts {
// rename scripts from, e.g. `desktop` to `bisq-desktop`
applicationName = "bisq-$applicationName"

// edit generated shell scripts such that they expect to be executed in the
// project root dir as opposed to a 'bin' subdirectory
doLast {
def windowsScriptFile = file getWindowsScript()
windowsScriptFile.text = windowsScriptFile.text.replace(
'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%')

def unixScriptFile = file getUnixScript()
unixScriptFile.text = unixScriptFile.text.replace(
'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null')
}
}
}

Expand Down

0 comments on commit aecfd22

Please sign in to comment.