From 552414978ed74e7cd77bd57874f6fbbe3e0024c4 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 27 Oct 2020 01:46:43 +0900 Subject: 0.24.0-rc1 --- src/constants.go | 3 --- src/core.go | 2 +- src/update_assets.rb | 47 ----------------------------------------------- 3 files changed, 1 insertion(+), 51 deletions(-) delete mode 100755 src/update_assets.rb (limited to 'src') diff --git a/src/constants.go b/src/constants.go index ca181ed0..9842e0bf 100644 --- a/src/constants.go +++ b/src/constants.go @@ -9,9 +9,6 @@ import ( ) const ( - // Current version - version = "0.24.0" - // Core coordinatorDelayMax time.Duration = 100 * time.Millisecond coordinatorDelayStep time.Duration = 10 * time.Millisecond diff --git a/src/core.go b/src/core.go index bd45df69..ef470a80 100644 --- a/src/core.go +++ b/src/core.go @@ -43,7 +43,7 @@ Matcher -> EvtHeader -> Terminal (update header) */ // Run starts fzf -func Run(opts *Options, revision string) { +func Run(opts *Options, version string, revision string) { sort := opts.Sort > 0 sortCriteria = opts.Criteria diff --git a/src/update_assets.rb b/src/update_assets.rb deleted file mode 100755 index 531a8eeb..00000000 --- a/src/update_assets.rb +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -# http://www.rubydoc.info/github/rest-client/rest-client/RestClient -require 'rest_client' -require 'json' - -if ARGV.length < 3 - puts "usage: #{$PROGRAM_NAME} " - exit 1 -end - -token, version, *files = ARGV -base = 'https://api.github.com/repos/junegunn/fzf-bin/releases' - -# List releases -rels = JSON.parse(RestClient.get(base, authorization: "token #{token}")) -rel = rels.find { |r| r['tag_name'] == version } -unless rel - puts "#{version} not found" - exit 1 -end - -# List assets -assets = Hash[rel['assets'].map { |a| a.values_at('name', 'id') }] - -files.select { |f| File.exist?(f) }.map do |file| - Thread.new do - name = File.basename(file) - - if asset_id = assets[name] # rubocop:todo Lint/AssignmentInCondition - puts "#{name} found. Deleting asset id #{asset_id}." - RestClient.delete("#{base}/assets/#{asset_id}", - authorization: "token #{token}") - else - puts "#{name} not found" - end - - puts "Uploading #{name}" - RestClient.post( - "#{base.sub('api', 'uploads')}/#{rel['id']}/assets?name=#{name}", - File.read(file), - authorization: "token #{token}", - content_type: 'application/octet-stream' - ) - end -end.each(&:join) -- cgit v1.2.3