Skip to content

Commit

Permalink
Add --make-exports to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jbn committed Nov 2, 2017
1 parent b603931 commit 21d27d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pathsjson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def main(args=None):
action='store_true',
help='Print exports for shell')

parser.add_argument('--make-exports',
action='store_true',
help='Print exports for Makefile eval')

parser.add_argument('--init-globals',
action='store_true',
help='Create the global paths.json file')
Expand All @@ -37,6 +41,14 @@ def main(args=None):
print('export {}="{}"'.format(k, v))
sys.exit(0)

# https://stackoverflow.com/questions/16656789/import-environment-settings-into-makefile-ubuntu-and-osx
if args.make_exports:
from pathsjson.automagic import PATHS

for k, v in PATHS.all_resolvable_paths.items():
print('{}="{}"'.format(k, v))
sys.exit(0)

if args.init_globals:
print(create_user_globals_file())
sys.exit(0)
Expand Down

0 comments on commit 21d27d2

Please sign in to comment.