Skip to content

Commit

Permalink
Fix typo: DEST -> DEST_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
tmillr committed May 23, 2023
1 parent 469da35 commit 3f324ef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/update-colors.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Get/Update Primer Color Primitives

env:
_DEST: '${{ github.workspace }}/lua/github-theme/palette/primitives'
_DEST_DIR: '${{ github.workspace }}/lua/github-theme/palette/primitives'
_JSON_DIR: '${{ github.workspace }}/node_modules/@primer/primitives/dist/json/colors'
_LICENSE_GLOB: '${{ github.workspace }}/node_modules/@primer/primitives/[Ll][Ii][Cc][Ee][Nn][Ss][Ee]*'
_PRIMITIVES_PKGJSON: '${{ github.workspace }}/node_modules/@primer/primitives/package.json'
Expand Down Expand Up @@ -29,19 +29,21 @@ jobs:
set -u +f
shopt -s nocaseglob failglob
license="$(<$_LICENSE_GLOB)"
mkdir -p "$_DEST"
rm -r "$_DEST_DIR" || :
mkdir -p "$_DEST_DIR"
cd "$_JSON_DIR"
if jq -e .version "$_PRIMITIVES_PKGJSON"; then
version="M._VERSION = vim.json.decode([=[$(jq -e .version "$_PRIMITIVES_PKGJSON")]=], { luanil = { object = false, array = false } })"
fi
for file in *.json; do
cat >"${_DEST_DIR}/${file%.json}.lua" <<EOF
cat >|"${_DEST_DIR}/${file%.json}.lua" <<EOF
-- NOTE: THIS IS AN AUTO-GENERATED FILE. DO NOT EDIT BY-HAND.
local M = vim.json.decode([=[$(<"$file")]=], { luanil = { object = false, array = false } })
${version-}
M._LICENSE = [=[$license]=]
M._LICENSE = [=[
$license]=]
return M
EOF
done
Expand Down

0 comments on commit 3f324ef

Please sign in to comment.