diff --git a/dot_jq/colors.jq b/dot_jq/colors.jq.tmpl similarity index 87% rename from dot_jq/colors.jq rename to dot_jq/colors.jq.tmpl index 6c9eddc..707681e 100644 --- a/dot_jq/colors.jq +++ b/dot_jq/colors.jq.tmpl @@ -1,3 +1,4 @@ +{{ if lookPath "jq" -}} def reset: "\u001b[0m"; def black: "\u001b[30m"; def white: "\u001b[97m"; @@ -7,3 +8,4 @@ def green: "\u001b[32m"; def yellow: "\u001b[33m"; def red: "\u001b[31m"; def magenta: "\u001b[35m"; +{{- end }} diff --git a/dot_jq/env.jq b/dot_jq/env.jq.tmpl similarity index 92% rename from dot_jq/env.jq rename to dot_jq/env.jq.tmpl index efb648d..8321398 100644 --- a/dot_jq/env.jq +++ b/dot_jq/env.jq.tmpl @@ -1,3 +1,4 @@ +{{ if lookPath "jq" -}} def browser: env.BROWSER; def editor: env.EDITOR; def home: env.HOME; @@ -12,3 +13,4 @@ def config: env.XDG_CONFIG_HOME; def data: env.XDG_DATA_HOME; def runtime: env.XDG_RUNTIME_DIR; def state: env.XDG_STATE_HOME; +{{- end }} diff --git a/dot_jq/github.jq b/dot_jq/github.jq.tmpl similarity index 95% rename from dot_jq/github.jq rename to dot_jq/github.jq.tmpl index 6d32ad8..040989d 100644 --- a/dot_jq/github.jq +++ b/dot_jq/github.jq.tmpl @@ -1,3 +1,4 @@ +{{ if lookPath "jq" -}} def by_time: sort_by(.created_at) | reverse; def asset($os; $arch): @@ -25,4 +26,4 @@ assets ] | join("\n") ) "; - +{{- end }}