forked from cwtch.im/cwtch-ui
Merge pull request 'macosBits' (#180) from macosBits into trunk
Reviewed-on: cwtch.im/cwtch-ui#180 Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
commit
f3b09d3e3a
11
README.md
11
README.md
|
@ -12,7 +12,7 @@ This README covers build instructions, for information on Cwtch itself please go
|
|||
- `install.home.sh` installs the app into your home directory
|
||||
- `install.sys.sh` as root to install system wide
|
||||
- or run out of the unziped directory
|
||||
- MacOS: Cwtch.dmg coming soon...
|
||||
- MacOS: Available from [https://cwtch.im/download/](https://cwtch.im/download/) as a .dmg
|
||||
|
||||
## Running
|
||||
|
||||
|
@ -32,12 +32,9 @@ This project uses the flutter `dev` channel, which you will need to switch to: `
|
|||
|
||||
Once flutter is set up, run `flutter pub get` from this project folder to fetch dependencies.
|
||||
|
||||
By default a development version is built, which loads profiles from `$CWTCH_HOME/dev/`.
|
||||
To build a release version and load normal profiles, add something like the
|
||||
following to the `flutter build` commands below:
|
||||
```
|
||||
--dart-define BUILD_VER="`git describe --tags --abbrev=1`" --dart-define BUILD_DATE="`date +%G-%m-%d-%H-%M`"
|
||||
```
|
||||
By default a development version is built, which loads profiles from `$CWTCH_HOME/dev/`. This is so that you can build
|
||||
and test development builds with alternative profiles while running a release/stable version of Cwtch uninterrupted.
|
||||
To build a release version and load normal profiles, use `build-release.sh X` instead of `flutter build X`
|
||||
|
||||
### Building on Linux (for Linux)
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "build-release.sh [android|linux|macos|windows]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "VERSION" ]; then
|
||||
VERSION=`cat VERSION`
|
||||
else
|
||||
VERSION=`git describe --tags --abbrev=1`
|
||||
fi
|
||||
|
||||
if [ -f "BUILDDATE" ]; then
|
||||
BUILDDATE=`cat BUILDDATE`
|
||||
else
|
||||
BUILDDATE=`date +%G-%m-%d-%H-%M`
|
||||
fi
|
||||
|
||||
flutter build $1 --dart-define BUILD_VER=$VERSION --dart-define BUILD_DATE=$BUILDDATE
|
|
@ -136,6 +136,21 @@ class CwtchFfi implements Cwtch {
|
|||
}
|
||||
}
|
||||
|
||||
// the first Cwtch MacOS release (1.2) accidently was a dev build
|
||||
// we need to temporarily remedy this for a release or two then delete
|
||||
// if macOs and release build and no profile and is dev profile
|
||||
// copy dev profile to release profile
|
||||
if (Platform.isMacOS && EnvironmentConfig.BUILD_VER != dev_version) {
|
||||
var devProfileExists = await Directory(path.join(cwtchDir, "dev", "profiles")).exists();
|
||||
var releaseProfileExists = await Directory(path.join(cwtchDir, "profiles")).exists();
|
||||
if (devProfileExists && !releaseProfileExists) {
|
||||
print("MacOS one time dev -> release profile migration...");
|
||||
await Process.run("cp", ["-r", "-p", path.join(cwtchDir, "dev", "profiles"), cwtchDir]);
|
||||
await Process.run("cp", ["-r", "-p", path.join(cwtchDir, "dev", "SALT"), cwtchDir]);
|
||||
await Process.run("cp", ["-r", "-p", path.join(cwtchDir, "dev", "ui.globals"), cwtchDir]);
|
||||
}
|
||||
}
|
||||
|
||||
if (EnvironmentConfig.BUILD_VER == dev_version) {
|
||||
cwtchDir = path.join(cwtchDir, "dev");
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ class FlwtchState extends State<Flwtch> {
|
|||
Future.delayed(Duration(seconds: 2)).then((value) {
|
||||
if (Platform.isAndroid) {
|
||||
SystemNavigator.pop();
|
||||
} else if (Platform.isLinux || Platform.isWindows) {
|
||||
} else if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
|
||||
print("Exiting...");
|
||||
exit(0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue