Skip to content

Commit

Permalink
Address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlocke committed Feb 8, 2024
1 parent fbf621f commit 4679628
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions generate_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
import subprocess
import sys

def dir_path(string):
if os.path.isdir(string):
return string
else:
raise NotADirectoryError(string)

cmdline_desc = """\
Runs Stone to generate Obj-C types and client for the Dropbox client.
"""
Expand Down Expand Up @@ -53,8 +59,8 @@
)
_cmdline_parser.add_argument(
'-fs',
'--format-script-dir',
type=str,
'--format-script-path',
type=dir_path,
help='Path to format script directory.',
)
_cmdline_parser.add_argument(
Expand Down Expand Up @@ -94,7 +100,7 @@ def main():
os.path.abspath('Source/ObjectiveDropboxOfficial/Shared/Generated')
dropbox_pkg_path = args.output_path if args.output_path else dropbox_default_output_path

dropbox_format_script_dir = args.format_script_dir if args.format_script_dir else \
dropbox_format_script_path = args.format_script_path if args.format_script_path else \
os.path.abspath('Format')

dropbox_format_output_path = args.format_output_path if args.format_output_path else dropbox_src_path
Expand Down Expand Up @@ -166,7 +172,7 @@ def main():
print('Formatting source files')

cmd = ['./format_files.sh', dropbox_format_output_path]
o = subprocess.check_output(cmd, cwd=dropbox_format_script_dir)
o = subprocess.check_output(cmd, cwd=dropbox_format_script_path)
if o:
print('Output:', o)

Expand Down

0 comments on commit 4679628

Please sign in to comment.