Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
It takes several files or directories as src and generates the code
in the given dst directory.
"""
global builtin_config
builtin_config_path = here / '.config'
if 'IVIGENERATOR_CONFIG' in os.environ:
builtin_config_path = os.environ['IVIGENERATOR_CONFIG']
builtin_config = yaml.load(open(builtin_config_path), Loader=yaml.SafeLoader)
if not 'VERSION' in builtin_config or not 'FEATURES' in builtin_config:
sys.exit("Invalid builtin config")
if reload:
script = '{0} {1} {2}'.format(Path(__file__).abspath(), ' '.join(src), dst)
monitor(src, script)
else:
moduleConfig = {
"module": module,
"force": force
}
run(format, moduleConfig, annotations, src, dst)
def app(src, dst, reload):
"""Takes several files or directories as src and generates the code
in the given dst directory."""
if reload:
script = Path(__file__).abspath()
monitor(script, src, dst)
else:
run(src, dst)
def app(src, dst, reload):
"""Takes several files or directories as src and generates the code
in the given dst directory."""
if reload:
script = Path(__file__).abspath()
monitor(script, src, dst)
else:
run(src, dst)
def main(rules, target, reload, source, watch, scaffold, feature, force, run):
rules = Path(rules)
if reload:
argv = sys.argv.copy()
argv.remove('--reload')
watch_list = list(source)
watch_list.append(rules.dirname())
if watch:
watch_list.append(watch)
monitor(args=argv, watch=watch_list)
else:
features = set(feature)
if scaffold:
features.add('scaffold')
run_generator(rules, source, target, features=features, force=force)
if run:
sh(run)