Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #20: Set the default directory based on the package name #22

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Set the default directory based on the package name
  • Loading branch information
hussainweb committed Aug 5, 2020
commit 88ab373bd8e7437e0edc26488148e3dbe4fac07c
11 changes: 7 additions & 4 deletions axltempl/drupal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
@click.option(
"--directory",
help="Directory where the files should be set up (e.g., drupal). "
+ "The directory will be emptied.",
+ "The directory will be emptied. The default is based on the specified name.",
type=click.Path(exists=False, file_okay=False),
default=".",
show_default=True,
default="",
)
@click.option("--description", help="Description of the package", default="")
@click.option(
Expand Down Expand Up @@ -78,7 +77,7 @@
is_flag=True,
)
def main(
name,
name: util.ComposerVersion,
directory,
description,
core_package,
Expand All @@ -99,6 +98,10 @@ def main(
if not no_install:
ensure_memory_limit()

name = name[0]
if directory == "":
directory = name.get_package_name()

prepare_base_directory(directory, force)
os.chdir(directory)
os.system('git init; git commit --allow-empty -m "Initial commit"')
Expand Down