Skip to content

Commit 17a254b

Browse files
committed
Create full file path if not exists when specifying a file output
1 parent e4c2417 commit 17a254b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

django_sass/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.1.1"

django_sass/management/commands/sass.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ def compile_sass(self, outfile, **kwargs):
5050
# If used with filename, it will return a string of file contents.
5151
if rval and outfile:
5252
# Write the outputted css to file
53+
outfile_dir = os.path.dirname(outfile)
54+
if not os.path.exists(outfile_dir):
55+
os.makedirs(outfile_dir, exist_ok=True)
5356
file = open(outfile, "w")
5457
file.write(rval)
5558
file.close()

0 commit comments

Comments
 (0)