Skip to content

Commit

Permalink
Added os.path.expanduser (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshDaryani896 authored Nov 9, 2023
1 parent b86fd18 commit c118076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/ycqlsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ def resolve_cql_history_file():
except OSError:
print('\nWarning: Cannot create directory at `%s`. Command history will not be saved. Please check what was the environment property CQL_HISTORY set to.\n' % HISTORY_DIR)

DEFAULT_CQLSHRC = os.path.join('~', '.cassandra', 'cqlshrc')
DEFAULT_CQLSHRC = os.path.expanduser(os.path.join('~', '.cassandra', 'cqlshrc'))

if hasattr(options, 'cqlshrc'):
CONFIG_FILE = options.cqlshrc
CONFIG_FILE = os.path.expanduser(options.cqlshrc)
if not os.path.exists(CONFIG_FILE):
print('\nWarning: Specified cqlshrc location `%s` does not exist. Using `%s` instead.\n' % (CONFIG_FILE, DEFAULT_CQLSHRC))
CONFIG_FILE = DEFAULT_CQLSHRC
Expand Down

0 comments on commit c118076

Please sign in to comment.