From 6de69579c81a75dcf85dc9af8962069b752ecba0 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 14 Jul 2020 20:25:48 +0000 Subject: [PATCH] add hexyl --- hexyl/README.md | 38 ++++++++++++++++++++++++++++++++++++++ hexyl/install.sh | 31 +++++++++++++++++++++++++++++++ hexyl/releases.js | 20 ++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 hexyl/README.md create mode 100644 hexyl/install.sh create mode 100644 hexyl/releases.js diff --git a/hexyl/README.md b/hexyl/README.md new file mode 100644 index 0000000..2628f29 --- /dev/null +++ b/hexyl/README.md @@ -0,0 +1,38 @@ +--- +title: hexyl +homepage: https://github.com/sharkdp/hexyl +tagline: | + hexyl is a simple hex viewer for the terminal. +--- + +## Updating + +```bash +webi hexyl@stable +``` + +Use the `@beta` tag for pre-releases. + +## Cheat Sheet + +![](https://camo.githubusercontent.com/1f71ee7031e1962b23f21c8cc89cb837e1201238/68747470733a2f2f692e696d6775722e636f6d2f4d574f3975534c2e706e67) + +> It uses a colored output to distinguish different categories of bytes (NULL +> bytes, printable ASCII characters, ASCII whitespace characters, other ASCII +> characters and non-ASCII). + +`hexyl` is pretty self-explanatory. + +If you know that you need a _hex viewer_, then you probably already know enough +to see why this is particularly useful, and can figure out how to use it. + +```bash +echo "hello" > foo.bin +hexyl foo.bin +``` + +For options, such as `--length`, `--skip`, and `--offset`, see: + +```bash +hexyl --help +``` diff --git a/hexyl/install.sh b/hexyl/install.sh new file mode 100644 index 0000000..281c6c3 --- /dev/null +++ b/hexyl/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +{ + set -e + set -u + + ############### + # Install hexyl # + ############### + + WEBI_SINGLE=true + + pkg_get_current_version() { + # 'hexyl --version' has output in this format: + # hexyl 0.8.0 + # This trims it down to just the version number: + # 0.8.0 + echo $(hexyl --version 2>/dev/null | head -n 1 | cut -d' ' -f 2) + } + + pkg_install() { + # $HOME/.local/ + mkdir -p "$pkg_src_bin" + + # mv ./hexyl-*/hexyl "$HOME/.local/opt/hexyl-v0.8.0/bin/hexyl-v0.8.0" + mv ./hexyl-*/hexyl "$pkg_src_cmd" + + # chmod a+x "$HOME/.local/xbin/rg-v11.1.0" + chmod a+x "$pkg_src_cmd" + } +} diff --git a/hexyl/releases.js b/hexyl/releases.js new file mode 100644 index 0000000..ca28ed3 --- /dev/null +++ b/hexyl/releases.js @@ -0,0 +1,20 @@ +'use strict'; + +var github = require('../_common/github.js'); +var owner = 'sharkdp'; +var repo = 'hexyl'; + +module.exports = function (request) { + return github(request, owner, repo).then(function (all) { + return all; + }); +}; + +if (module === require.main) { + module.exports(require('@root/request')).then(function (all) { + all = require('../_webi/normalize.js')(all); + all.releases = all.releases.slice(0, 10); + //console.info(JSON.stringify(all)); + console.info(JSON.stringify(all, null, 2)); + }); +} -- 2.25.1