@@ -31,25 +31,28 @@ export function addBootstrapCommands(program: Command): void {
3131 . option ( "--skip-forms" , "Skip the forms processing step" , false )
3232 . option ( "--force" , "Reprocess all items, ignoring processed state" , false )
3333 . action ( async ( options ) => {
34- await runCommand ( async ( ) => {
35- if ( ! options . skipDownload ) {
36- for ( const config of Object . values ( BULK_DOWNLOADS ) ) {
37- const task = new BootstrapDownloadTask ( config ) ;
38- await runTasks ( task ) ;
34+ await runCommand (
35+ async ( ) => {
36+ if ( ! options . skipDownload ) {
37+ for ( const config of Object . values ( BULK_DOWNLOADS ) ) {
38+ const task = new BootstrapDownloadTask ( config ) ;
39+ await runTasks ( task ) ;
40+ }
3941 }
40- }
4142
42- if ( ! options . skipIngest ) {
43- const cikWf = pipe ( [ new FetchAllCikNamesTask ( ) , new StoreCikNamesTask ( ) ] ) ;
44- await runWorkflow ( cikWf ) ;
45- await runTasks ( new BootstrapSubmissionsTask ( { force : options . force } ) ) ;
46- await runTasks ( new BootstrapCompanyFactsTask ( { force : options . force } ) ) ;
47- }
43+ if ( ! options . skipIngest ) {
44+ const cikWf = pipe ( [ new FetchAllCikNamesTask ( ) , new StoreCikNamesTask ( ) ] ) ;
45+ await runWorkflow ( cikWf ) ;
46+ await runTasks ( new BootstrapSubmissionsTask ( { force : options . force } ) ) ;
47+ await runTasks ( new BootstrapCompanyFactsTask ( { force : options . force } ) ) ;
48+ }
4849
49- if ( ! options . skipForms ) {
50- await runTasks ( new UpdateAllFormsTask ( { form : [ "D" , "C" ] , force : options . force } ) ) ;
51- }
52- } ) ;
50+ if ( ! options . skipForms ) {
51+ await runTasks ( new UpdateAllFormsTask ( { form : [ "D" , "C" ] , force : options . force } ) ) ;
52+ }
53+ } ,
54+ { force : options . force }
55+ ) ;
5356 } ) ;
5457
5558 bootstrap
@@ -85,32 +88,35 @@ export function addBootstrapCommands(program: Command): void {
8588 . description ( "Ingest pre-downloaded SEC data (submissions, facts, cik-names, or all)" )
8689 . option ( "--force" , "Reprocess all items, ignoring processed state" , false )
8790 . action ( async ( domain : string | undefined , options ) => {
88- await runCommand ( async ( ) => {
89- const target = domain ?? "all" ;
91+ await runCommand (
92+ async ( ) => {
93+ const target = domain ?? "all" ;
9094
91- if ( target === "cik-names" || target === "all" ) {
92- const wf = pipe ( [ new FetchAllCikNamesTask ( ) , new StoreCikNamesTask ( ) ] ) ;
93- await runWorkflow ( wf ) ;
94- }
95+ if ( target === "cik-names" || target === "all" ) {
96+ const wf = pipe ( [ new FetchAllCikNamesTask ( ) , new StoreCikNamesTask ( ) ] ) ;
97+ await runWorkflow ( wf ) ;
98+ }
9599
96- if ( target === "submissions" || target === "all" ) {
97- await runTasks ( new BootstrapSubmissionsTask ( { force : options . force } ) ) ;
98- }
100+ if ( target === "submissions" || target === "all" ) {
101+ await runTasks ( new BootstrapSubmissionsTask ( { force : options . force } ) ) ;
102+ }
99103
100- if ( target === "facts" || target === "all" ) {
101- await runTasks ( new BootstrapCompanyFactsTask ( { force : options . force } ) ) ;
102- }
104+ if ( target === "facts" || target === "all" ) {
105+ await runTasks ( new BootstrapCompanyFactsTask ( { force : options . force } ) ) ;
106+ }
103107
104- if (
105- target !== "all" &&
106- target !== "submissions" &&
107- target !== "facts" &&
108- target !== "cik-names"
109- ) {
110- throw new Error (
111- `Invalid domain "${ target } ". Must be submissions, facts, cik-names, or all.`
112- ) ;
113- }
114- } ) ;
108+ if (
109+ target !== "all" &&
110+ target !== "submissions" &&
111+ target !== "facts" &&
112+ target !== "cik-names"
113+ ) {
114+ throw new Error (
115+ `Invalid domain "${ target } ". Must be submissions, facts, cik-names, or all.`
116+ ) ;
117+ }
118+ } ,
119+ { force : options . force }
120+ ) ;
115121 } ) ;
116122}
0 commit comments