Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Get full path to rc
Browse files Browse the repository at this point in the history
  • Loading branch information
danghai authored and major committed May 15, 2018
1 parent a908642 commit e4f8173
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions skt/executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ def save_state(cfg, state):
logging.debug("state: %s -> %s", key, val)
config.set('state', key, val)

# FIXME Move expansion up the call stack, as this limits the function
# usefulness, because tilde is a valid path character.
with open(os.path.expanduser(cfg.get('rc')), 'w') as fp:
with open(cfg.get('rc'), 'w') as fp:
config.write(fp)


Expand Down Expand Up @@ -354,9 +352,7 @@ def cmd_cleanup(cfg):
config = cfg.get('_parser')
if config.has_section('state'):
config.remove_section('state')
# FIXME Move expansion up the call stack, as this limits the function
# usefulness, because tilde is a valid path character.
with open(os.path.expanduser(cfg.get('rc')), 'w') as fp:
with open(cfg.get('rc'), 'w') as fp:
config.write(fp)

if cfg.get('buildinfo'):
Expand Down Expand Up @@ -717,6 +713,10 @@ def load_config(args):
if cfg.get('basecfg'):
cfg['basecfg'] = full_path(cfg.get('basecfg'))

# Get an absolute path for the configuration file
if cfg.get('rc'):
cfg['rc'] = full_path(cfg.get('rc'))

return cfg


Expand Down

0 comments on commit e4f8173

Please sign in to comment.