File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
engine/packages/engine/src/commands/db Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ pub enum SubCommand {
1212 #[ clap( short = 'q' , long) ]
1313 query : Option < String > ,
1414 } ,
15+ Nuke {
16+ #[ clap( long) ]
17+ yes : bool ,
18+ } ,
1519}
1620
1721#[ derive( ValueEnum , Clone , PartialEq ) ]
@@ -54,6 +58,23 @@ impl SubCommand {
5458
5559 Ok ( ( ) )
5660 }
61+ Self :: Nuke { yes } => {
62+ if !yes {
63+ bail ! ( "Please pass '--yes' flag to confirm you want to nuke the database" ) ;
64+ }
65+
66+ match config. database ( ) {
67+ rivet_config:: config:: Database :: Postgres ( _) => {
68+ bail ! ( "nuke postgres not implemented" ) ;
69+ }
70+ rivet_config:: config:: Database :: FileSystem ( file_system) => {
71+ println ! ( "Removing {}" , file_system. path. display( ) ) ;
72+ tokio:: fs:: remove_dir_all ( & file_system. path ) . await ?;
73+ println ! ( "Complete" ) ;
74+ Ok ( ( ) )
75+ }
76+ }
77+ }
5778 }
5879 }
5980}
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
66
77cd " ${REPO_ROOT} "
88
9- RUST_LOG=debug \
9+ RUST_LOG=" ${RUST_LOG :- debug} " \
1010cargo run --bin rivet-engine -- start " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
5+ REPO_ROOT=" $( cd " ${SCRIPT_DIR} /../.." && pwd) "
6+
7+ cd " ${REPO_ROOT} "
8+
9+ rm -rf " ~/Library/Application Support/rivet-engine/"
You can’t perform that action at this time.
0 commit comments