mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 07:18:12 +08:00
create annotations output dir if it does not exist (#1062)
* create annotations output dir if it doees not exist * lint
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import errno
|
import errno
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
from os import devnull
|
from os import devnull, mkdir
|
||||||
from os.path import splitext, basename, isdir
|
from os.path import splitext, basename, isdir
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
@@ -298,8 +298,11 @@ def launch(
|
|||||||
raise click.FileError(basename(experimental_annotations_file), hint="annotation file type must be .csv")
|
raise click.FileError(basename(experimental_annotations_file), hint="annotation file type must be .csv")
|
||||||
|
|
||||||
if experimental_annotations_output_dir is not None and not isdir(experimental_annotations_output_dir):
|
if experimental_annotations_output_dir is not None and not isdir(experimental_annotations_output_dir):
|
||||||
raise click.ClickException('--experimental-annotations-output-dir must specify an existing directory. '
|
try:
|
||||||
f'"{experimental_annotations_output_dir}" does not exist.')
|
mkdir(experimental_annotations_output_dir)
|
||||||
|
except OSError:
|
||||||
|
raise click.ClickException("Unable to create directory specified by "
|
||||||
|
"--experimental-annotations-output-dir")
|
||||||
|
|
||||||
if about:
|
if about:
|
||||||
def url_check(url):
|
def url_check(url):
|
||||||
|
|||||||
Reference in New Issue
Block a user