forked from cwtch.im/cwtch-ui
Add support for CWTCH_DIR env var
This commit is contained in:
parent
84a0ca5d19
commit
057732c445
|
@ -1 +1 @@
|
||||||
v1.0.0-25-g801a805-2021-07-07-16-10
|
v1.0.0-27-g4d218df-2021-07-07-23-27
|
||||||
|
|
|
@ -11,10 +11,12 @@ This README covers build instructions, for information on Cwtch itself please go
|
||||||
- Linux: Available from [https://cwtch.im/download/](https://cwtch.im/download/) as a .tar.gz
|
- Linux: Available from [https://cwtch.im/download/](https://cwtch.im/download/) as a .tar.gz
|
||||||
- `install.home.sh` installs the app into your home directory
|
- `install.home.sh` installs the app into your home directory
|
||||||
- `install.sys.sh` as root to install system wide
|
- `install.sys.sh` as root to install system wide
|
||||||
|
- or run out of the unziped directory
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
Cwtch logging is controlable with the following environment variables:
|
Cwtch processes the following environment variables:
|
||||||
|
- `CWTCH_HOME=` overrides the default storage path of `~/.cwtch` with what ever you choose
|
||||||
- `LOG_FILE=` will reroute all of libcwtch-go's logging to the specified file instead of the console
|
- `LOG_FILE=` will reroute all of libcwtch-go's logging to the specified file instead of the console
|
||||||
- `LOG_LEVEL=debug` will set the log level to debug instead of info
|
- `LOG_LEVEL=debug` will set the log level to debug instead of info
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ class CwtchFfi implements Cwtch {
|
||||||
String bundledTor = "";
|
String bundledTor = "";
|
||||||
Map<String, String> envVars = Platform.environment;
|
Map<String, String> envVars = Platform.environment;
|
||||||
if (Platform.isLinux) {
|
if (Platform.isLinux) {
|
||||||
home = (envVars['HOME'])!;
|
home = envVars['HOME']!;
|
||||||
if (await File("linux/tor").exists()) {
|
if (await File("linux/tor").exists()) {
|
||||||
bundledTor = "linux/tor";
|
bundledTor = "linux/tor";
|
||||||
} else if (await File("lib/tor").exists()) {
|
} else if (await File("lib/tor").exists()) {
|
||||||
|
@ -102,10 +102,11 @@ class CwtchFfi implements Cwtch {
|
||||||
bundledTor = "tor";
|
bundledTor = "tor";
|
||||||
}
|
}
|
||||||
} else if (Platform.isWindows) {
|
} else if (Platform.isWindows) {
|
||||||
home = (envVars['UserProfile'])!;
|
home = envVars['UserProfile']!;
|
||||||
bundledTor = "Tor\\Tor\\tor.exe";
|
bundledTor = "Tor\\Tor\\tor.exe";
|
||||||
}
|
}
|
||||||
var cwtchDir = path.join(home, ".cwtch");
|
|
||||||
|
var cwtchDir = envVars['CWTCH_HOME'] ?? path.join(home, ".cwtch");
|
||||||
if (EnvironmentConfig.BUILD_VER == dev_version) {
|
if (EnvironmentConfig.BUILD_VER == dev_version) {
|
||||||
cwtchDir = path.join(cwtchDir, "dev");
|
cwtchDir = path.join(cwtchDir, "dev");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue