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