Skip to content

Commit

Permalink
Merge pull request #171 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Pull init style fix into main for release
  • Loading branch information
mathomp4 committed May 26, 2021
2 parents 4e590d8 + e8bb913 commit 1bd0212
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
7 changes: 5 additions & 2 deletions mepo.d/command/init/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ def run(args):
else:
print(f'Found style [{style}] in .mepoconfig')
else:
style = 'prefix'
style = None

allcomps = MepoState.initialize(args.config,style)

print(f'Initializing mepo using {args.config} with {style} style.')
if not style:
print(f'Initializing mepo using {args.config}')
else:
print(f'Initializing mepo using {args.config} with {style} style')
22 changes: 14 additions & 8 deletions mepo.d/state/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,20 @@ def get_current_remote_url():
return output

def decorate_node(item, flag, style):
item = item.replace(flag,'')
if style == 'naked':
output = item
elif style == 'prefix':
output = flag + item
elif style == 'postfix':
output = item + flag
return output
# If we do not pass in a style...
if not style:
# Just use what's in components.yaml
return item
# else use the style
else:
item = item.replace(flag,'')
if style == 'naked':
output = item
elif style == 'prefix':
output = flag + item
elif style == 'postfix':
output = item + flag
return output

# From https://learning.oreilly.com/library/view/python-cookbook/0596001673/ch04s16.html
def splitall(path):
Expand Down

0 comments on commit 1bd0212

Please sign in to comment.