Skip to content

Commit fefa2a3

Browse files
updated to add scan & zip changes
1 parent 7414617 commit fefa2a3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/datacustomcode/cli.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ def init(directory: str):
156156
@click.argument("filename")
157157
@click.option("--config")
158158
@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+
161163

162164
config_location = config or os.path.join(os.path.dirname(filename), "config.json")
163165
click.echo(
@@ -172,6 +174,13 @@ def scan(filename: str, config: str, dry_run: bool):
172174
with open(config_location, "w") as f:
173175
json.dump(config_json, f, indent=2)
174176

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+
175184

176185
@cli.command()
177186
@click.argument("entrypoint")

0 commit comments

Comments
 (0)