summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-10-27 01:46:43 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-10-27 11:07:27 +0900
commit552414978ed74e7cd77bd57874f6fbbe3e0024c4 (patch)
treeffb8cb0796983c6e56c4f47a3216697386f3482e /src
parent607081bbaab228f41ebfe1f7aa0e993ab134c205 (diff)
0.24.0-rc10.24.0-rc1
Diffstat (limited to 'src')
-rw-r--r--src/constants.go3
-rw-r--r--src/core.go2
-rwxr-xr-xsrc/update_assets.rb47
3 files changed, 1 insertions, 51 deletions
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} <token> <version> <files...>"
- 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)