Skip to content

Commit 9969092

Browse files
committed
Log whether render_patterns is dry run or not
1 parent 199265a commit 9969092

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pattern_library/management/commands/render_patterns.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def handle(self, **options):
3939
request = factory.get('/')
4040

4141
if self.verbosity >= 2:
42-
self.stderr.write(f'Target directory: {self.output_dir}')
42+
if self.dry_run:
43+
self.stderr.write(f'Target directory: {self.output_dir}. Dry run, not writing files to disk')
44+
else:
45+
self.stderr.write(f'Target directory: {self.output_dir}')
4346

4447
# Resolve the output dir according to the directory the command is run from.
4548
parent_dir = Path.cwd().joinpath(self.output_dir)

tests/tests/test_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_verbose_output(self):
2323
stdout = io.StringIO()
2424
stderr = io.StringIO()
2525
call_command('render_patterns', dry_run=True, stdout=stdout, stderr=stderr, verbosity=2)
26-
self.assertIn("""Target directory: dpl-rendered-patterns
26+
self.assertIn("""Target directory: dpl-rendered-patterns. Dry run, not writing files to disk
2727
Group: atoms
2828
Group: icons
2929
Pattern: icon.html

0 commit comments

Comments
 (0)