Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add format script dir argument to generate script #376

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 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 @@ -51,6 +57,12 @@
type=str,
help='Path to format output.',
)
_cmdline_parser.add_argument(
'-fs',
'--format-script-path',
type=dir_path,
help='Path to format script directory.',
)
_cmdline_parser.add_argument(
'-e',
'--exclude-from-analysis',
Expand Down Expand Up @@ -84,9 +96,13 @@ def main():
stone_path = args.stone

dropbox_src_path = os.path.abspath('Source')
dropbox_default_output_path = os.path.abspath('Source/ObjectiveDropboxOfficial/Shared/Generated')
dropbox_default_output_path = \
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_path = os.path.abspath('Format')

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

# clear out all old files
Expand Down
Loading