MCPcopy Create free account
hub / github.com/ampproject/amphtml / SetupOutDir

Function SetupOutDir

validator/js/webui/build.py:61–74  ·  view source on GitHub ↗

Sets up a clean output directory. Args: out_dir: directory name of the output directory. Must not have slashes, dots, etc.

(out_dir)

Source from the content-addressed store, hash-verified

59
60
61def SetupOutDir(out_dir):
62 """Sets up a clean output directory.
63
64 Args:
65 out_dir: directory name of the output directory. Must not have slashes,
66 dots, etc.
67 """
68 logging.info('entering ...')
69 assert re.match(r'^[a-zA-Z_\-0-9]+$', out_dir), 'bad out_dir: %s' % out_dir
70
71 if os.path.exists(out_dir):
72 subprocess.check_call(['rm', '-rf', out_dir])
73 os.mkdir(out_dir)
74 logging.info('... done')
75
76
77def InstallNodeDependencies():

Callers 1

MainFunction · 0.70

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected