diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-05-20 09:51:28 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-05-20 09:51:28 -0400 |
commit | bb160dbf30440144d002810ebd5c5520e37562d7 (patch) | |
tree | b3afb50ae21ab352621923e5eb38c018f004d53c /alembic | |
parent | 7bdc7e43325612739d049202cf24e5a0e5be5724 (diff) | |
download | alembic-bb160dbf30440144d002810ebd5c5520e37562d7.tar.gz |
- [bug] Fixed bug whereby directories inside of
the template directories, such as __pycache__
on Pypy, would mistakenly be interpreted as
files which are part of the template. #49
Diffstat (limited to 'alembic')
-rw-r--r-- | alembic/command.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/alembic/command.py b/alembic/command.py index ed7b830..98a054b 100644 --- a/alembic/command.py +++ b/alembic/command.py @@ -39,20 +39,21 @@ def init(config, directory, template='generic'): script = ScriptDirectory(directory) for file_ in os.listdir(template_dir): + file_path = os.path.join(template_dir, file_) if file_ == 'alembic.ini.mako': config_file = os.path.abspath(config.config_file_name) if os.access(config_file, os.F_OK): util.msg("File %s already exists, skipping" % config_file) else: script._generate_template( - os.path.join(template_dir, file_), + file_path, config_file, script_location=directory ) - else: + elif os.path.isfile(file_path): output_file = os.path.join(directory, file_) script._copy_file( - os.path.join(template_dir, file_), + file_path, output_file ) |