Skip to content

Commit 6bc67f4

Browse files
committed
feat: add help file
- include the readme as the help file in the built zip
1 parent 287e893 commit 6bc67f4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

scripts/release

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ github_repo="gamemaker1/micro-plugin-prettier"
2525
github_remote="origin"
2626
# The GitHub branch
2727
github_branch="main"
28-
# Space-separated list of files to include in the zip
28+
# Space-separated list of lua files
2929
source_files=("source/prettier.lua")
30+
# Help file
31+
help_file="readme.md"
3032
# The metadata file (should ALWAYS be /repo.json)
3133
metadata_file="repo.json"
3234

@@ -68,8 +70,9 @@ echo "[info] Pushed to Github"
6870

6971
# Create a zip file with files needed by Micro
7072
rm -rf build/
71-
mkdir -p build/ && cd build/
73+
mkdir -p build/help && cd build/
7274
cp "../$metadata_file" "./repo.json"
75+
cp "../$help_file" "./help/$plugin_name.md"
7376
for file in "${source_files[@]}"; do
7477
cp "../$file" "./"
7578
done

source/prettier.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ function format(file)
153153
options = options .. " " .. value.flag .. "=" .. tostring(value.default)
154154
end
155155
end
156-
buffer.Log(options)
157156

158157
-- Run prettier on the file
159158
local command = "prettier" .. options .. " --no-color --write " .. file.Buf.Path
@@ -194,4 +193,7 @@ function init()
194193

195194
-- Register the `format` command
196195
config.MakeCommand("format", format, config.NoComplete)
196+
197+
-- Register the help file
198+
config.AddRuntimeFile("prettier", config.RTHelp, "help/prettier.md")
197199
end

0 commit comments

Comments
 (0)