Skip to content

Commit

Permalink
fix: Don't require existing config to check version
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsvante committed Jun 2, 2022
1 parent 352bdd6 commit b9982bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions netsuite/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def main():

subparser_name = sys.argv[-1]

# Call version directly to avoid loading of config
if subparser_name == "version":
print(args.func())
return

# Show help section instead of an error when no arguments were passed...
if subparser_name == "rest-api":
rest_api_parser.print_help()
Expand Down
2 changes: 1 addition & 1 deletion netsuite/cli/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ def add_parser(parser, subparser):
return (version_parser, None)


def version(config, args) -> str:
def version() -> str:
return pkg_resources.get_distribution("netsuite").version

0 comments on commit b9982bf

Please sign in to comment.