Skip to content

Commit

Permalink
- [bug] Fixed bug whereby directories inside of
Browse files Browse the repository at this point in the history
  the template directories, such as __pycache__
  on Pypy, would mistakenly be interpreted as
  files which are part of the template. #49
  • Loading branch information
zzzeek committed May 20, 2012
1 parent 7bdc7e4 commit bb160db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"alembic downgrade -1". Courtesy
Atsushi Odagiri for this feature.

- [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

0.3.2
=====
- [feature] Basic support for Oracle added,
Expand Down
7 changes: 4 additions & 3 deletions alembic/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit bb160db

Please sign in to comment.