user/tests/accept/features/support/build.rb
# Last application path is cached in order to not flash the same application for every scenario
Last application path is cached in order to not flash the same application for every scenario
Last application path is cached in order to not flash the same application for every scenario
def flash_app_cli(bin_path, flasher='dfu', devid=nil)
        incmd = 'yes'
        if flasher == 'ota' and !devid.nil?
          flasher = devid
          if Particle::Util.env_var('PLATFORM') == 'electron'
            bytes = Particle::Util.cellular_data_usage(File.size(bin_path))
            incmd = "echo #{bytes}"
          end
        else
          flasher = "--#{flasher}"
        end
        cmd = Util.shell_out("#{incmd} | particle flash #{flasher} #{bin_path}")
        cmd.run_command
        @last_flash_result = cmd.error?
        puts cmd.stdout
        puts cmd.stderr
        sleep(2)
        return @last_flash_result
      end
def flash_app_cli ( bin_path , flasher = 'dfu' , devid = nil ) incmd = 'yes' if flasher == 'ota' and ! devid . nil? flasher = devid if Particle :: Util . env_var ( 'PLATFORM' ) == 'electron' bytes = Particle :: Util . cellular_data_usage ( File . size ( bin_path ) ) incmd = "echo #{bytes}" end else flasher = "--#{flasher}" end cmd = Util . shell_out ( "#{incmd} | particle flash #{flasher} #{bin_path}" ) cmd . run_command @last_flash_result = cmd . error? puts cmd . stdout puts cmd . stderr sleep ( 2 ) return @last_flash_result end
Last application path is cached in order to not flash the same application for every scenario
Last application path is cached in order to not flash the same application for every scenario
bin_path
<not_specific>
flasher
<not_specific>
devid
<not_specific>