Sets up a clean output directory. Args: out_dir: directory name of the output directory. Must not have slashes, dots, etc.
(out_dir)
| 101 | |
| 102 | |
| 103 | def 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 | |
| 119 | def InstallNodeDependencies(): |