Skip to content

Commit

Permalink
Fix #193: Add place to start 'pre-flight' checks (#214)
Browse files Browse the repository at this point in the history
* Add a module where we can run tests for invariants for the application

* Fix 193: Add pre-flight checks

* Fix build
  • Loading branch information
bryphe committed Apr 3, 2019
1 parent d81f3ac commit f2d166b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/editor/bin/Oni2.re
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ let init = app => {
let cliOptions = Core.Cli.parse(setup);
Sys.chdir(cliOptions.folder);

PreflightChecks.run();

let currentState = ref(Model.State.create());

let onStateChanged = v => {
Expand Down
17 changes: 17 additions & 0 deletions src/editor/bin/PreflightChecks.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* PreflightChecks.re
*
* This establishes and verifies a set of invariants to ensure the environment
* is set up correctly for the application to run.
*/

open Oni_Core;

let checkHomeDirectoryOrThrow = () => {
let _ = Filesystem.unsafeFindHome();
();
};

let run = () => {
checkHomeDirectoryOrThrow();
};

0 comments on commit f2d166b

Please sign in to comment.