mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Add --force option to override directory
This commit is contained in:
parent
8eb9a2b355
commit
448a916d0d
|
@ -61,16 +61,17 @@ class CLI(object):
|
||||||
|
|
||||||
@plac.annotations(
|
@plac.annotations(
|
||||||
input_dir=("directory with model data", "positional", None, str),
|
input_dir=("directory with model data", "positional", None, str),
|
||||||
output_dir=("output directory", "positional", None, str)
|
output_dir=("output directory", "positional", None, str),
|
||||||
|
force=("force overwriting of existing output directory", "flag", "f", bool)
|
||||||
)
|
)
|
||||||
def package(self, input_dir, output_dir):
|
def package(self, input_dir, output_dir, force=False):
|
||||||
"""
|
"""
|
||||||
Generate Python package for model data, including meta and required
|
Generate Python package for model data, including meta and required
|
||||||
installation files. A new directory will be created in the specified
|
installation files. A new directory will be created in the specified
|
||||||
output directory, and model data will be copied over.
|
output directory, and model data will be copied over.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cli_package(input_dir, output_dir)
|
cli_package(input_dir, output_dir, force)
|
||||||
|
|
||||||
|
|
||||||
def __missing__(self, name):
|
def __missing__(self, name):
|
||||||
|
|
|
@ -9,7 +9,7 @@ from .. import about
|
||||||
from .. import util
|
from .. import util
|
||||||
|
|
||||||
|
|
||||||
def package(input_dir, output_dir):
|
def package(input_dir, output_dir, force):
|
||||||
input_path = Path(input_dir)
|
input_path = Path(input_dir)
|
||||||
output_path = Path(output_dir)
|
output_path = Path(output_dir)
|
||||||
check_dirs(input_path, output_path)
|
check_dirs(input_path, output_path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user