Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def main():
# Read the configuration either from .dazelrc or from the environment.
di = DockerInstance.from_config()
# If there is no .dazel_run file, or it is too old, start the DockerInstance.
if (not os.path.exists(di.dazel_run_file) or
not di.is_running() or
(os.path.exists(di.dockerfile) and
os.path.getctime(di.dockerfile) > os.path.getctime(di.dazel_run_file))):
rc = di.start()
if rc:
return rc
# Forward the command line arguments to the container.
return di.send_command(sys.argv[1:])