lib/lhj/command/yapi.rb in lhj-tools-0.1.70 vs lib/lhj/command/yapi.rb in lhj-tools-0.1.71

- old
+ new

@@ -100,17 +100,17 @@ def save_to_file(service_code) file_name = gen_model_name('') unless File.exist?(File.expand_path(sub_folder_name, '.')) FileUtils.mkdir_p(File.expand_path(sub_folder_name, '.')) end - h_file = File.join('.', api_id, sub_folder_name, "#{file_name}.h") - m_file = File.join('.', api_id, sub_folder_name, "#{file_name}.m") - service_file = File.join('.', api_id, sub_folder_name, "#{model_pre}#{model_name}Service.m") + h_file = File.join('.', sub_folder_name, "#{file_name}.h") + m_file = File.join('.', sub_folder_name, "#{file_name}.m") + service_file = File.join('.', sub_folder_name, "#{model_pre}#{model_name}Service.m") File.write(h_file, @h_file_array.join("\n")) if @h_file_array.count.positive? File.write(m_file, @m_file_array.join("\n")) if @m_file_array.count.positive? File.write(service_file, service_code) if service_code puts "\n\n生成文件成功!所在路径:\n#{File.expand_path(h_file)} \n#{File.expand_path(m_file)}".green - { h_file: h_file, m_file: m_file, s_file: service_file } + { h_file: h_file, m_file: m_file, s_file: service_file, api_id: api_id } end def push_to_git Actions.sh('git checkout master') Actions.sh('git add .')