@@ -145,8 +145,10 @@ def deploy(
145145
146146@cli .command ()
147147@click .argument ("directory" , default = "." )
148- @click .option ("--type" , default = "script" , type = click .Choice (["script" , "function" ]))
149- def init (directory : str , type : str ):
148+ @click .option (
149+ "--code-type" , default = "script" , type = click .Choice (["script" , "function" ])
150+ )
151+ def init (directory : str , code_type : str ):
150152 from datacustomcode .scan import (
151153 dc_config_json_from_file ,
152154 update_config ,
@@ -155,18 +157,18 @@ def init(directory: str, type: str):
155157 from datacustomcode .template import copy_function_template , copy_script_template
156158
157159 click .echo ("Copying template to " + click .style (directory , fg = "blue" , bold = True ))
158- if type == "script" :
160+ if code_type == "script" :
159161 copy_script_template (directory )
160- elif type == "function" :
162+ elif code_type == "function" :
161163 copy_function_template (directory )
162164 entrypoint_path = os .path .join (directory , "payload" , "entrypoint.py" )
163165 config_location = os .path .join (os .path .dirname (entrypoint_path ), "config.json" )
164166
165167 # Write package type to SDK-specific config
166- sdk_config = {"type" : type }
168+ sdk_config = {"type" : code_type }
167169 write_sdk_config (directory , sdk_config )
168170
169- config_json = dc_config_json_from_file (entrypoint_path , type )
171+ config_json = dc_config_json_from_file (entrypoint_path , code_type )
170172 with open (config_location , "w" ) as f :
171173 json .dump (config_json , f , indent = 2 )
172174
0 commit comments