Moved a function to a more logic place.

This commit is contained in:
meeh
2018-05-01 03:40:07 +00:00
parent 8957c85486
commit 3488db38bc
2 changed files with 8 additions and 6 deletions

View File

@@ -18,6 +18,13 @@ import java.io.{File, InputStream}
*/
object DeployProfile {
/**
* This function will find the executing jar. "myself"
* @return
*/
def executingJarFile = getClass().getProtectionDomain().getCodeSource().getLocation()
/**
* This joins two paths in a cross platform way. Meaning it takes care of either we use
* \\ or / as directory separator. It returns the resulting path in a string.

View File

@@ -76,11 +76,6 @@ class OSXDeployment extends
OSXDefaults.getOSXBaseDirectory.getAbsolutePath
) {
/**
* This function will find the executing jar. "myself"
* @return
*/
def executingJarFile = getClass().getProtectionDomain().getCodeSource().getLocation()
/**
@@ -125,7 +120,7 @@ class OSXDeployment extends
*/
def copyDirFromRes(dir: File): Unit = {
// A small hack
val zipFile = new ZipFile(executingJarFile.getFile)
val zipFile = new ZipFile(DeployProfile.executingJarFile.getFile)
zipFile.entries().asScala.toList.filter(_.toString.startsWith(dir.getPath)).filter(!_.isDirectory).map { entry =>
new File(DeployProfile.pathJoin(baseDir,entry.getName)).getParentFile.mkdirs()
if (entry.isDirectory) {