mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1132409 - [mozlog] Create directories for log specified on the command line if not present. r=jgraham
This commit is contained in:
parent
55ed4fbd1d
commit
515e07407e
@ -3,6 +3,7 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import optparse
|
||||
|
||||
from collections import defaultdict
|
||||
@ -59,7 +60,10 @@ fmt_options = {
|
||||
def log_file(name):
|
||||
if name == "-":
|
||||
return sys.stdout
|
||||
else:
|
||||
# ensure we have a correct dirpath by using realpath
|
||||
dirpath = os.path.dirname(os.path.realpath(name))
|
||||
if not os.path.exists(dirpath):
|
||||
os.makedirs(dirpath)
|
||||
return open(name, "w")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user