+++ /dev/null
----
-title: lf
-homepage: https://github.com/gokcehan/lf
-tagline: |
- lf: terminal file manager written in Go
----
-
-To update or switch versions, run `webi lf@stable` (or `@v2`, `@beta`,
-etc).
-
-## Cheat Sheet
-
-> 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
-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
-```
-
-### For documentation
-```bash
-lf -doc
-```
+++ /dev/null
-#!/usr/bin/env pwsh
-
-##################
-# Install lf #
-##################
-
-$pkg_cmd_name = "lf"
-
-$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\lf.exe"
-$pkg_dst = "$pkg_dst_cmd"
-
-$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\lf-v$Env:WEBI_VERSION\bin\lf.exe"
-$pkg_src_bin = "$Env:USERPROFILE\.local\opt\lf-v$Env:WEBI_VERSION\bin"
-$pkg_src_dir = "$Env:USERPROFILE\.local\opt\lf-v$Env:WEBI_VERSION"
-$pkg_src = "$pkg_src_cmd"
-
-$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
-
-IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
-{
- 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"
-}
-
-IF (!(Test-Path -Path "$pkg_src_cmd"))
-{
- echo "Installing lf"
-
- pushd .local\tmp
-
- Remove-Item -Path ".\lf-v*" -Recurse -ErrorAction Ignore
- Remove-Item -Path ".\lf.exe" -Recurse -ErrorAction Ignore
-
- echo "Unpacking $pkg_download"
- & tar xf "$pkg_download"
-
- echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory -Force
- Move-Item -Path ".\lf-*\lf.exe" -Destination "$pkg_src_bin"
-
- popd
-}
-
-echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
-Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore
-Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
+++ /dev/null
-#!/bin/bash
-
-function __init_lf() {
- set -e
- set -u
-
- ##################
- # Install lf #
- ##################
-
- pkg_cmd_name="lf"
-
- pkg_dst_cmd="$HOME/.local/bin/lf"
- pkg_dst="$pkg_dst_cmd"
-
- pkg_src_cmd="$HOME/.local/opt/lf-v$WEBI_VERSION/bin/lf"
- pkg_src_dir="$HOME/.local/opt/lf-v$WEBI_VERSION"
- pkg_src="$pkg_src_cmd"
-
- pkg_install() {
- mkdir -p "$(dirname $pkg_src_cmd)"
- mv ./lf-*/lf "$pkg_src_cmd"
- }
-
- pkg_get_current_version() {
- echo $(lf --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2)
- }
-
-}
-
-__init_lf
+++ /dev/null
-'use strict';
-
-var github = require('../_common/github.js');
-var owner = 'gokcehan';
-var repo = 'lf';
-
-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, 5);
- console.info(JSON.stringify(all, null, 2));
- });
-}
--- /dev/null
+---
+title: lf
+homepage: https://github.com/gokcehan/lf
+tagline: |
+ lf: terminal file manager written in Go
+---
+
+To update or switch versions, run `webi lf@stable` (or `@v2`, `@beta`, etc).
+
+## Cheat Sheet
+
+> 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
+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
+```
+
+### For documentation
+
+```bash
+lf --doc
+```
--- /dev/null
+#!/usr/bin/env pwsh
+
+##############
+# Install lf #
+##############
+
+$pkg_cmd_name = "lf"
+
+$pkg_dst_cmd = "$Env:USERPROFILE\.local\bin\lf.exe"
+$pkg_dst = "$pkg_dst_cmd"
+
+$pkg_src_cmd = "$Env:USERPROFILE\.local\opt\lf-v$Env:WEBI_VERSION\bin\lf.exe"
+$pkg_src_bin = "$Env:USERPROFILE\.local\opt\lf-v$Env:WEBI_VERSION\bin"
+$pkg_src_dir = "$Env:USERPROFILE\.local\opt\lf-v$Env:WEBI_VERSION"
+$pkg_src = "$pkg_src_cmd"
+
+$pkg_download = "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"
+
+IF (!(Test-Path -Path "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE"))
+{
+ 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"
+}
+
+IF (!(Test-Path -Path "$pkg_src_cmd"))
+{
+ echo "Installing lf"
+
+ pushd .local\tmp
+
+ Remove-Item -Path ".\lf.exe" -Recurse -ErrorAction Ignore
+
+ echo "Unpacking $pkg_download"
+ & tar xf "$pkg_download"
+
+ echo "Install Location: $pkg_src_cmd"
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
+ Move-Item -Path ".\lf.exe" -Destination "$pkg_src_bin"
+
+ popd
+}
+
+echo "Copying into '$pkg_dst_cmd' from '$pkg_src_cmd'"
+Remove-Item -Path "$pkg_dst_cmd" -Recurse -ErrorAction Ignore
+Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse
--- /dev/null
+#!/bin/bash
+
+function __init_lf() {
+ set -e
+ set -u
+
+ ##############
+ # Install lf #
+ ##############
+
+ # Every package should define these 6 variables
+ pkg_cmd_name="lf"
+
+ pkg_dst_cmd="$HOME/.local/bin/lf"
+ pkg_dst="$pkg_dst_cmd"
+
+ pkg_src_cmd="$HOME/.local/opt/lf-v$WEBI_VERSION/bin/lf"
+ pkg_src_dir="$HOME/.local/opt/lf-v$WEBI_VERSION"
+ pkg_src="$pkg_src_cmd"
+
+ pkg_install() {
+ # $HOME/.local/opt/lf-v0.21.0/bin
+ mkdir -p "$(dirname $pkg_src_cmd)"
+
+ # mv ./lf "$HOME/.local/opt/lf-v0.21.0/bin/lf"
+ mv ./lf "$pkg_src_cmd"
+
+ # chmod a+x "$HOME/.local/opt/lf-v0.21.0/bin/lf"
+ chmod a+x "$pkg_src_cmd"
+ }
+
+ pkg_get_current_version() {
+ # 'lf version' has output in this format:
+ # r21
+ # This treats it as a minor version number:
+ # 0.21.0
+ echo "0.$(lf --version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^r::').0"
+ }
+
+}
+
+__init_lf
--- /dev/null
+'use strict';
+
+var github = require('../_common/github.js');
+var owner = 'gokcehan';
+var repo = 'lf';
+
+module.exports = function (request) {
+ return github(request, owner, repo).then(function (all) {
+ all.releases = all.releases.map(function (r) {
+ // r21 -> 0.21.0
+ if (/^r/.test(r.version)) {
+ r.version = '0.' + r.version.replace('r', '') + '.0';
+ }
+ return r;
+ });
+ return all;
+ });
+};
+
+if (module === require.main) {
+ module.exports(require('@root/request')).then(function (all) {
+ all = require('../_webi/normalize.js')(all);
+ all.releases = all.releases
+ .filter(function (r) {
+ return (
+ ['windows', 'macos', 'linux'].includes(r.os) && 'amd64' === r.arch
+ );
+ })
+ .slice(0, 10);
+ console.info(JSON.stringify(all, null, 2));
+ });
+}