From: Michael D. Lowis Date: Wed, 19 Jul 2017 23:38:17 +0000 (-0400) Subject: updated fetch to support osx X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=4a3e4397d3e64fb382145acf15f413582130aa59;p=projs%2Ftide.git updated fetch to support osx --- 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