mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-23 22:16:48 +00:00
Added cheatsheet to readme
This commit is contained in:
+27
-21
@@ -1,35 +1,41 @@
|
||||
---
|
||||
title: Foo Bar
|
||||
homepage: https://github.com/webinstall/foobar
|
||||
title: lf
|
||||
homepage: https://github.com/gokcehan/lf
|
||||
tagline: |
|
||||
foobar: An example that doesn't exist.
|
||||
lf: terminal file manager written in Go
|
||||
---
|
||||
|
||||
<!--
|
||||
Note: Delete this comment section.
|
||||
|
||||
Need an example that has an **alias**? See `bat`.
|
||||
Need a Windows example using **msvc**? See `bat`.
|
||||
-->
|
||||
|
||||
To update or switch versions, run `webi example@stable` (or `@v2`, `@beta`,
|
||||
To update or switch versions, run `webi lf@stable` (or `@v2`, `@beta`,
|
||||
etc).
|
||||
|
||||
## Cheat Sheet
|
||||
|
||||
> `foo` doesn't exist and this text should have been replaced. It doesn't do
|
||||
> anything, but what it does is useful because it is; everybody knows it.
|
||||
|
||||
To run foo:
|
||||
> lf (as in "list files") is a terminal file manager written in Go. It is heavily inspired by ranger with some missing and extra features.
|
||||
|
||||
To start the application in the current directory:
|
||||
```bash
|
||||
foo
|
||||
lf
|
||||
```
|
||||
### Navigating in lf:
|
||||
| Action | Command/Key |
|
||||
|-----------|-------------|
|
||||
| quit | 'q' |
|
||||
| up | 'k' or '\<up>' |
|
||||
| page-up | '\<pgup>' |
|
||||
| down | 'j' or '\<down>' |
|
||||
| page-down | '\<pgdn>' |
|
||||
| updir | 'h' or '\<left>' |
|
||||
| open | 'l' or '\<right>' |
|
||||
| top | 'gg' and '\<home>' |
|
||||
| bottom | 'G' and '\<end>' |
|
||||
|||
|
||||
|
||||
### For command line options:
|
||||
```bash
|
||||
lf -help
|
||||
```
|
||||
|
||||
### Add Baz Highlighting
|
||||
|
||||
To run foo with both bar and baz highlighting turned on:
|
||||
|
||||
### For documentation
|
||||
```bash
|
||||
foo --bar=baz
|
||||
lf -doc
|
||||
```
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
# Install lf #
|
||||
##################
|
||||
|
||||
# Every package should define these variables
|
||||
$pkg_cmd_name = "lf"
|
||||
|
||||
$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\lf.exe"
|
||||
@@ -17,10 +16,8 @@ $pkg_src = "$pkg_src_cmd"
|
||||
|
||||
$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
|
||||
|
||||
# Fetch archive
|
||||
IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
|
||||
{
|
||||
# TODO: arch detection
|
||||
echo "Downloading lf from $Env:WEBI_PKG_URL to $pkg_download"
|
||||
& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_PKG_URL" -o "$pkg_download.part"
|
||||
& move "$pkg_download.part" "$pkg_download"
|
||||
@@ -30,29 +27,18 @@ IF (!(Test-Path -Path "$pkg_src_cmd"))
|
||||
{
|
||||
echo "Installing lf"
|
||||
|
||||
# TODO: create package-specific temp directory
|
||||
# Enter tmp
|
||||
pushd .local\tmp
|
||||
|
||||
# Remove any leftover tmp cruft
|
||||
Remove-Item -Path ".\lf-v*" -Recurse -ErrorAction Ignore
|
||||
Remove-Item -Path ".\lf.exe" -Recurse -ErrorAction Ignore
|
||||
|
||||
# NOTE: DELETE THIS COMMENT IF NOT USED
|
||||
# Move single binary into root of temporary folder
|
||||
#& move "$pkg_download" "lf.exe"
|
||||
|
||||
# Unpack archive file into this temporary directory
|
||||
# Windows BSD-tar handles zip. Imagine that.
|
||||
echo "Unpacking $pkg_download"
|
||||
& tar xf "$pkg_download"
|
||||
|
||||
# Settle unpacked archive into place
|
||||
echo "Install Location: $pkg_src_cmd"
|
||||
New-Item "$pkg_src_bin" -ItemType Directory -Force
|
||||
Move-Item -Path ".\lf-*\lf.exe" -Destination "$pkg_src_bin"
|
||||
|
||||
# Exit tmp
|
||||
popd
|
||||
}
|
||||
|
||||
|
||||
+1
-11
@@ -7,8 +7,7 @@ function __init_lf() {
|
||||
##################
|
||||
# Install lf #
|
||||
##################
|
||||
|
||||
# Every package should define these 6 variables
|
||||
|
||||
pkg_cmd_name="lf"
|
||||
|
||||
pkg_dst_cmd="$HOME/.local/bin/lf"
|
||||
@@ -18,21 +17,12 @@ function __init_lf() {
|
||||
pkg_src_dir="$HOME/.local/opt/lf-v$WEBI_VERSION"
|
||||
pkg_src="$pkg_src_cmd"
|
||||
|
||||
# pkg_install must be defined by every package
|
||||
pkg_install() {
|
||||
# ~/.local/opt/lf-v0.99.9/bin
|
||||
mkdir -p "$(dirname $pkg_src_cmd)"
|
||||
|
||||
# mv ./lf-*/lf ~/.local/opt/lf-v0.99.9/bin/lf
|
||||
mv ./lf-*/lf "$pkg_src_cmd"
|
||||
}
|
||||
|
||||
# pkg_get_current_version is recommended, but (soon) not required
|
||||
pkg_get_current_version() {
|
||||
# 'lf --version' has output in this format:
|
||||
# lf 0.99.9 (rev abcdef0123)
|
||||
# This trims it down to just the version number:
|
||||
# 0.99.9
|
||||
echo $(lf --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ module.exports = function (request) {
|
||||
if (module === require.main) {
|
||||
module.exports(require('@root/request')).then(function (all) {
|
||||
all = require('../_webi/normalize.js')(all);
|
||||
// just select the first 5 for demonstration
|
||||
all.releases = all.releases.slice(0, 5);
|
||||
console.info(JSON.stringify(all, null, 2));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user