Skip to content

Commit

Permalink
Fixes bug where if the container was already running, running start w…
Browse files Browse the repository at this point in the history
…ould error with unintuitive error.
  • Loading branch information
thekevinbrown committed May 15, 2019
1 parent 1ef6dad commit adb05d5
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/cli/lamington-start.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import { startEos } from './utils';
import { startEos, eosIsReady, stopContainer } from './utils';

/**
* Starts EOS and throws caught errors
* @note This should handle caught errors
* Stops EOS docker container if it's running, then starts it.
* @note Keep alive setup is incomplete
* @author Kevin Brown <github.com/thekevinbrown>
*/
startEos().catch(error => {
throw error;
const run = async () => {
// Stop running instances for fresh test environment
if (await eosIsReady()) {
await stopContainer();
}

await startEos();
};

run().catch(async error => {
process.exitCode = 1;
console.log(error);
});

0 comments on commit adb05d5

Please sign in to comment.