diff --git a/.github/workflows/update-colors.yml b/.github/workflows/update-colors.yml index 6d67aa67..cb47edf8 100644 --- a/.github/workflows/update-colors.yml +++ b/.github/workflows/update-colors.yml @@ -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' @@ -29,7 +29,8 @@ 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 @@ -37,11 +38,12 @@ jobs: fi for file in *.json; do - cat >"${_DEST_DIR}/${file%.json}.lua" <|"${_DEST_DIR}/${file%.json}.lua" <