@@ -156,8 +156,10 @@ def init(directory: str):
156
156
@click .argument ("filename" )
157
157
@click .option ("--config" )
158
158
@click .option ("--dry-run" , is_flag = True )
159
- def scan (filename : str , config : str , dry_run : bool ):
160
- from datacustomcode .scan import dc_config_json_from_file
159
+ @click .option ("--no-requirements" , is_flag = True , help = "Skip generating requirements.txt file" )
160
+ def scan (filename : str , config : str , dry_run : bool , no_requirements : bool ):
161
+ from datacustomcode .scan import dc_config_json_from_file , write_requirements_file
162
+
161
163
162
164
config_location = config or os .path .join (os .path .dirname (filename ), "config.json" )
163
165
click .echo (
@@ -172,6 +174,13 @@ def scan(filename: str, config: str, dry_run: bool):
172
174
with open (config_location , "w" ) as f :
173
175
json .dump (config_json , f , indent = 2 )
174
176
177
+ if not no_requirements :
178
+ requirements_path = write_requirements_file (filename )
179
+ click .echo (
180
+ "Generated requirements file: "
181
+ + click .style (requirements_path , fg = "blue" , bold = True )
182
+ )
183
+
175
184
176
185
@cli .command ()
177
186
@click .argument ("entrypoint" )
0 commit comments