Skip to content

Commit

Permalink
Fix alias default export path (#146)
Browse files Browse the repository at this point in the history
* Fix alias default export path

* Fix typo

* Fix CI
  • Loading branch information
Ernest Wong authored and derekbekoe committed Apr 25, 2018
1 parent aa5b268 commit 91c6b35
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/alias/azext_alias/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long

from knack.help_files import helps # pylint: disable=unused-import


Expand Down Expand Up @@ -41,7 +43,7 @@

helps['alias export'] = """
type: command
short-summary: Export all registered aliases to a given path, as an INI configuration file.
short-summary: Export all registered aliases to a given path, as an INI configuration file. If no export path is specified, the alias configuration file is exported to the current working directory.
"""


Expand Down
5 changes: 4 additions & 1 deletion src/alias/azext_alias/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ def create_alias(alias_name, alias_command):
_commit_change(alias_table)


def export_aliases(export_path=os.path.abspath(ALIAS_FILE_NAME), exclusions=None):
def export_aliases(export_path=None, exclusions=None):
"""
Export all registered aliases to a given path, as an INI configuration file.
Args:
export_path: The path of the alias configuration file to export to.
exclusions: Space-separated aliases excluded from export.
"""
if not export_path:
export_path = os.path.abspath(ALIAS_FILE_NAME)

alias_table = get_alias_table()
for exclusion in exclusions or []:
if exclusion not in alias_table.sections():
Expand Down
2 changes: 1 addition & 1 deletion src/alias/azext_alias/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

VERSION = '0.5.0'
VERSION = '0.5.1'
10 changes: 5 additions & 5 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@
],
"alias": [
{
"filename": "alias-0.5.0-py2.py3-none-any.whl",
"sha256Digest": "f50723edb97a4f67535e0832d843abebf8272152efc4ec8201a48307999aa59c",
"downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/alias-0.5.0-py2.py3-none-any.whl",
"filename": "alias-0.5.1-py2.py3-none-any.whl",
"sha256Digest": "81b9a7f1824bffcbd6e72680891476151dde868e030cdbf1bfd9135e1a8f3447",
"downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/alias-0.5.1-py2.py3-none-any.whl",
"metadata": {
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.0.31.dev0",
Expand Down Expand Up @@ -500,7 +500,7 @@
}
},
"extras": [],
"generator": "bdist_wheel (0.29.0)",
"generator": "bdist_wheel (0.30.0)",
"license": "MIT",
"metadata_version": "2.0",
"name": "alias",
Expand All @@ -512,7 +512,7 @@
}
],
"summary": "Support for command aliases",
"version": "0.5.0"
"version": "0.5.1"
}
}
],
Expand Down

0 comments on commit 91c6b35

Please sign in to comment.