lib/fir/util/publish.rb in fir-cli-xsl-2.0.1 vs lib/fir/util/publish.rb in fir-cli-xsl-2.0.2

- old
+ new

@@ -13,26 +13,43 @@ url = "https://oapi.dingtalk.com/robot/send?access_token=#{options[:dingtalk_access_token]}" DefaultRest.post(url, payload) end end + def turn_off_history + # @file_type = "ipa" + # @token = options[:token] || current_token + # # @app_info = {"type": 'ipa', "identifier": 'com.sudiyi.appCourier', "name":'速递易快递', "version":'3.1.1', "build": 'haha'} + # # @user_info = fetch_user_info(@token) + # # logger.info ">>>> #{@user_info}" + # # @uploading_info = fetch_uploading_info + # # logger.info ">>>> uploading_info #{@uploading_info}" + # @app_id = '5be4f90f959d69333dd5ab5a' + + release_info = get(fir_api[:app_url] + "/#{@app_id}" + "/releases", api_token: @token, page: 1) + for temp_obj in release_info[:datas] + temp_id = temp_obj[:id] + patch fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{temp_id}", api_token: @token, is_history: false + end + end + def initialize_dtalk_options(args, options) @token = options[:token] || current_token @content = options[:content].to_s end def publish(*args, options) initialize_publish_options(args, options) check_supported_file_and_token logger_info_publishing_message - @app_info = send("#{@file_type}_info", @file_path, full_info: true) @user_info = fetch_user_info(@token) @uploading_info = fetch_uploading_info @app_id = @uploading_info[:id] + turn_off_history upload_app logger_info_dividing_line logger_info_app_short_and_qrcode(options) @@ -205,9 +222,11 @@ logger.info "Update release" ":#{@release_id}" + " info from fir.im" if nil != @release_id patch fir_api[:app_url] + "/#{@app_id}" + "/releases" + "/#{@release_id}", api_token: @token, is_history: true end + + end def upload_mapping_file_with_publish(options) return if !options[:mappingfile] || !options[:proj]