diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2023-01-02 15:32:05 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2023-01-02 15:32:05 -0500 |
commit | 588ff8bf959e3accfeb455291686a61f06cbd948 (patch) | |
tree | 4c1e8c0801cc6e23ac579298324878a33f673637 | |
parent | 682054104db9e055ad47887753a7e0cdb726e0eb (diff) | |
download | lite-xl-plugin-manager-588ff8bf959e3accfeb455291686a61f06cbd948.tar.gz lite-xl-plugin-manager-588ff8bf959e3accfeb455291686a61f06cbd948.zip |
Finished up table command.
-rw-r--r-- | .github/workflows/build.yml | 17 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | src/lpm.lua | 18 |
3 files changed, 27 insertions, 13 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e673a75..c873498 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,5 @@ name: CI on: { push: { branches: [master] } } -env: { VERSION: "0.9" } jobs: build_linux_windows: runs-on: ubuntu-latest @@ -11,7 +10,7 @@ jobs: with: fetch-depth: 0 - name: Clone Submodules - run: git submodule update --init --depth=1 + run: git submodule update --init --depth=1 && export VERSION=`git describe --tags | tail -c +2` - name: Build Linux run: | ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$VERSION-x86_64-linux-`git rev-parse --short HEAD`'"' && tar -czvf lpm-$VERSION-x86_64-linux.tar.gz lpm @@ -35,10 +34,9 @@ jobs: env: { GITHUB_TOKEN: "${{ github.token }}" } run: | gh release delete -y continuous || true; gh release create -t 'Continuous Release' continuous *.zip *.tar.gz *.deb - if [[ `git tag --points-at HEAD | head -c 4` == "v"* ]]; then - export RELEASE=`git tag --points-at HEAD | head -c 4 | sed 's/^v//'` - gh release delete -y v$RELEASE || true; - gh release create -t v$RELEASE v$RELEASE lpm.x86_64-linux lpm.x86_64-windows.exe + if [[ `git tag --points-at HEAD | head -c 1` == "v" ]]; then + gh release delete -y $VERSION || true; + gh release create -t v$VERSION v$VERSION lpm.x86_64-linux lpm.x86_64-windows.exe fi build_macos: @@ -52,14 +50,13 @@ jobs: with: fetch-depth: 0 - name: Clone Submodules - run: git submodule update --init --depth=1 + run: git submodule update --init --depth=1 && export VERSION=`git describe --tags | tail -c +2` - name: Build MacOS env: { GITHUB_TOKEN: "${{ github.token }}" } run: | ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$VERSION-x86_64-darwin-`git rev-parse --short HEAD`'"' && tar -czvf lpm-$VERSION-x86_64-darwin.tar.gz lpm cp lpm lpm.x86_64-darwin gh release upload continuous *.tar.gz - if [[ `git tag --points-at HEAD | head -c 4` == "v"* ]]; then - export RELEASE=`git tag --points-at HEAD | head -c 4 | sed 's/^v//'` - gh release upload v$RELEASE lpm.x86_64-darwin + if [[ `git tag --points-at HEAD | head -c 1` == "v" ]]; then + gh release upload $VERSION lpm.x86_64-darwin fi @@ -112,3 +112,8 @@ If you find a bug, please create an issue with the following information: * The commit or version of LPM you're using. * The exact steps to reproduce in LPM invocations, if possible from a fresh LPM install (targeting an empty folder with `--userdir`). + +| Plugin | Description | +| :----------------------------------------------- | :------------------------------------------------- | +| [`json`](plugins/json.lua?raw=1) | JSON support plugin, provides encoding/decoding. | +| [`plugin_manager`](plugins/plugin_manager?raw=1) | A GUI interface to the Adam's lite plugin manager. | diff --git a/src/lpm.lua b/src/lpm.lua index 493dc23..1c40343 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -1781,10 +1781,22 @@ in any circumstance unless explicitly supplied. local descriptions = common.map(plugins, function(e) return e.description or "" end) local max_description = math.max(table.unpack(common.map(descriptions, function(e) return #e end))) local max_name = math.max(table.unpack(common.map(names, function(e) return #e end))) - print("| Plugin" .. string.rep(" ", max_name - 6) .. " | Description" .. string.rep(" ", max_description - 11) .. " |") - print("| :" .. string.rep("-", max_name-1) .. " | :" .. string.rep("-", max_description - 1) .. " |") + local t = { } + table.insert(t, "| Plugin" .. string.rep(" ", max_name - 6) .. " | Description" .. string.rep(" ", max_description - 11) .. " |") + table.insert(t, "| :" .. string.rep("-", max_name-1) .. " | :" .. string.rep("-", max_description - 1) .. " |") for i = 1, #plugins do - print("| " .. names[i] .. string.rep(" ", max_name - #names[i]) .. " | " .. descriptions[i] .. string.rep(" ", max_description - #descriptions[i]) .. " |") + table.insert(t, "| " .. names[i] .. string.rep(" ", max_name - #names[i]) .. " | " .. descriptions[i] .. string.rep(" ", max_description - #descriptions[i]) .. " |") + end + if ARGS[4] then + local file = {} + for line in io.lines(ARGS[4]) do + if not line:find("^|.*") then + table.insert(file, line) + end + end + io.open(ARGS[4], "wb"):write(table.concat(file, "\n") .. "\n" .. table.concat(t, "\n") .. "\n") + else + print(table.concat(t, "\n")) end os.exit(0) end |