@@ -96,6 +96,7 @@ impl Command {
96
96
// add network name to data dir
97
97
let data_dir = self . datadir . unwrap_or_chain_default ( self . chain . chain ) ;
98
98
let db_path = data_dir. db_path ( ) ;
99
+ let static_files_path = data_dir. static_files_path ( ) ;
99
100
100
101
match self . command {
101
102
// TODO: We'll need to add this on the DB trait.
@@ -105,7 +106,7 @@ impl Command {
105
106
DatabaseArguments :: default ( ) . log_level ( self . db . log_level ) ,
106
107
) ?;
107
108
let provider_factory =
108
- ProviderFactory :: new ( db, self . chain . clone ( ) , data_dir . static_files_path ( ) ) ?;
109
+ ProviderFactory :: new ( db, self . chain . clone ( ) , static_files_path) ?;
109
110
110
111
let tool = DbTool :: new ( provider_factory, self . chain . clone ( ) ) ?;
111
112
command. execute ( data_dir, & tool) ?;
@@ -116,7 +117,7 @@ impl Command {
116
117
DatabaseArguments :: default ( ) . log_level ( self . db . log_level ) ,
117
118
) ?;
118
119
let provider_factory =
119
- ProviderFactory :: new ( db, self . chain . clone ( ) , data_dir . static_files_path ( ) ) ?;
120
+ ProviderFactory :: new ( db, self . chain . clone ( ) , static_files_path) ?;
120
121
121
122
let tool = DbTool :: new ( provider_factory, self . chain . clone ( ) ) ?;
122
123
command. execute ( & tool) ?;
@@ -127,7 +128,7 @@ impl Command {
127
128
DatabaseArguments :: default ( ) . log_level ( self . db . log_level ) ,
128
129
) ?;
129
130
let provider_factory =
130
- ProviderFactory :: new ( db, self . chain . clone ( ) , data_dir . static_files_path ( ) ) ?;
131
+ ProviderFactory :: new ( db, self . chain . clone ( ) , static_files_path) ?;
131
132
132
133
let tool = DbTool :: new ( provider_factory, self . chain . clone ( ) ) ?;
133
134
command. execute ( & tool) ?;
@@ -138,15 +139,15 @@ impl Command {
138
139
DatabaseArguments :: default ( ) . log_level ( self . db . log_level ) ,
139
140
) ?;
140
141
let provider_factory =
141
- ProviderFactory :: new ( db, self . chain . clone ( ) , data_dir . static_files_path ( ) ) ?;
142
+ ProviderFactory :: new ( db, self . chain . clone ( ) , static_files_path) ?;
142
143
143
144
let tool = DbTool :: new ( provider_factory, self . chain . clone ( ) ) ?;
144
145
command. execute ( & tool) ?;
145
146
}
146
147
Subcommands :: Drop { force } => {
147
148
if !force {
148
149
// Ask for confirmation
149
- print ! ( "Are you sure you want to drop the database at {db_path:? }? This cannot be undone. (y/N): " ) ;
150
+ print ! ( "Are you sure you want to drop the database at {data_dir }? This cannot be undone. (y/N): " ) ;
150
151
// Flush the buffer to ensure the message is printed immediately
151
152
io:: stdout ( ) . flush ( ) . unwrap ( ) ;
152
153
@@ -162,16 +163,16 @@ impl Command {
162
163
let db =
163
164
open_db ( & db_path, DatabaseArguments :: default ( ) . log_level ( self . db . log_level ) ) ?;
164
165
let provider_factory =
165
- ProviderFactory :: new ( db, self . chain . clone ( ) , data_dir . static_files_path ( ) ) ?;
166
+ ProviderFactory :: new ( db, self . chain . clone ( ) , static_files_path. clone ( ) ) ?;
166
167
167
168
let mut tool = DbTool :: new ( provider_factory, self . chain . clone ( ) ) ?;
168
- tool. drop ( db_path) ?;
169
+ tool. drop ( db_path, static_files_path ) ?;
169
170
}
170
171
Subcommands :: Clear ( command) => {
171
172
let db =
172
173
open_db ( & db_path, DatabaseArguments :: default ( ) . log_level ( self . db . log_level ) ) ?;
173
174
let provider_factory =
174
- ProviderFactory :: new ( db, self . chain . clone ( ) , data_dir . static_files_path ( ) ) ?;
175
+ ProviderFactory :: new ( db, self . chain . clone ( ) , static_files_path) ?;
175
176
176
177
command. execute ( provider_factory) ?;
177
178
}
0 commit comments