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

Function SetupOutDir

validator/build.py:103–116  ·  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

101
102
103def SetupOutDir(out_dir):
104 """Sets up a clean output directory.
105
106 Args:
107 out_dir: directory name of the output directory. Must not have slashes,
108 dots, etc.
109 """
110 logging.info('entering ...')
111 assert re.match(r'^[a-zA-Z_\-0-9]+$', out_dir), 'bad out_dir: %s' % out_dir
112
113 if os.path.exists(out_dir):
114 subprocess.check_call(['rm', '-rf', out_dir])
115 os.mkdir(out_dir)
116 logging.info('... done')
117
118
119def InstallNodeDependencies():

Callers 1

MainFunction · 0.70

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected