From 4a3e4397d3e64fb382145acf15f413582130aa59 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 19 Jul 2017 19:38:17 -0400 Subject: [PATCH] updated fetch to support osx --- lib/x11.c | 2 +- tide-fetch.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/x11.c b/lib/x11.c index 85c632a..4c3bf8d 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -263,7 +263,7 @@ static uint32_t special_keys(uint32_t key) { } static uint32_t getkey(XEvent* e) { - uint32_t rune = RUNE_ERR; + int32_t rune = RUNE_ERR; size_t len = 0; char buf[8]; KeySym key; diff --git a/tide-fetch.rb b/tide-fetch.rb index add4271..5fcfc6d 100755 --- a/tide-fetch.rb +++ b/tide-fetch.rb @@ -43,7 +43,11 @@ def open_with(app) end def find_files(file) - files = Dir.glob("./**/#{file}").sort_by(&:length) + if file.match(/^\.?\//) + files = [file] + else + files = Dir.glob("**/#{file}").sort_by(&:length) + end raise RuleError.new() if files.length == 0 files end @@ -53,7 +57,7 @@ def find_file(file) end def mimetype(regex) - mtype = `file -i #{$item} | cut -d' ' -f2` + mtype = `file --mime-type #{$item} | cut -d' ' -f2` if not mtype.match(regex) then raise RuleError.new() end -- 2.49.0