source: launchers/macosx/src/main/scala/net/i2p/MacOSXRouterLauncherApp.scala @ 345e741

Last change on this file since 345e741 was 345e741, checked in by meeh <meeh@…>, 3 years ago

Change current directory to base directory before starting the router.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package net.i2p
2
3import net.i2p.router.Router
4import net.i2p.launchers.{OSXDefaults, OSXDeployment}
5import java.io.File
6
7/**
8  *
9  * For java developers:
10  * A scala object is like an instance of a class.
11  * If you define a method inside an object, it's equals to
12  * java's static methods.
13  *
14  * Also, in scala, the body of a class/object is executed as it's
15  * constructor.
16  *
17  * Also noteworthy;
18  * val is immutable
19  * var is mutable
20  *
21  *
22  * The i2p base directory in the build should be in a relative path from
23  * the launcher, which would be ../Resources/i2pbase - this directory would
24  * need to be copied out to a "writable" area, since we're in a signed "immutable"
25  * bundle. First this launcher will check if i2pbase is already deployed to a
26  * writable area, if it's not, it deploys, if the i2pbase directory has an older
27  * version than the one in the bundle, it upgrades. It does nothing if versions
28  * matches.
29  *
30  *
31  * @author Meeh
32  * @version 0.0.1
33  * @since 0.9.35
34  */
35object MacOSXRouterLauncherApp extends App {
36
37  val i2pBaseDir = new File(OSXDefaults.getOSXBaseDirectory)
38
39  new OSXDeployment()
40
41  // Change directory to base dir
42  System.setProperty("user.dir", i2pBaseDir.getAbsolutePath)
43
44  Router.main(args)
45}
Note: See TracBrowser for help on using the repository browser.