Skip to content

Commit b3710b3

Browse files
authored
fix(macos): builds for playwright look different (#59)
1 parent 37d5d67 commit b3710b3

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ See: [lazy.nvim](https://github.com/folke/lazy.nvim)
7777
```lua
7878
{
7979
'mistweaverco/snap.nvim',
80-
version = 'v1.4.3',
80+
version = 'v1.4.4',
8181
---@type SnapUserConfig
8282
opts = {}
8383
},
@@ -93,7 +93,7 @@ See: [packer.nvim](https://github.com/wbthomason/packer.nvim)
9393
```lua
9494
use {
9595
'mistweaverco/snap.nvim',
96-
tag = 'v1.4.3',
96+
tag = 'v1.4.4',
9797
config = function()
9898

9999
---@type SnapUserConfig
@@ -112,7 +112,7 @@ use {
112112
```lua
113113
vim.pack.add({
114114
src = 'https://github.com/mistweaverco/snap.nvim.git',
115-
version = 'v1.4.3',
115+
version = 'v1.4.4',
116116
})
117117
---@type SnapUserConfig
118118
local cfg = {}
@@ -244,7 +244,7 @@ This would then translate to the following `font_settings`:
244244
```lua
245245
return {
246246
"mistweaverco/snap.nvim",
247-
version = 'v1.4.3',
247+
version = 'v1.4.4',
248248
---@type SnapUserConfig
249249
opts = {
250250
template = "linux",
@@ -373,7 +373,7 @@ by running `bun install` in the plugin directory.
373373
```lua
374374
{
375375
'mistweaverco/snap.nvim',
376-
version = 'v1.4.3',
376+
version = 'v1.4.4',
377377
opts = {
378378
timeout = 5000, -- Timeout for screenshot command in milliseconds
379379
log_level = "error", -- Log level for debugging (e.g., "trace", "debug", "info", "warn", "error", "off")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.4.3"
1+
return "1.4.4"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.4.3"
1+
return "1.4.4"

scripts/build.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ bun install --frozen-lockfile || { echo " ❌ Failed to install dependencies.";e
112112
cd ../.. || { echo " ❌ Failed to change to root directory.";echo;exit 1; }
113113

114114
CURRENT_CHROMIUM_LOCALES_DIR=$(find ./dist/.local-browsers -type d -iname 'locales')
115-
CURRENT_CHROMIUM_DIR=$(dirname "$CURRENT_CHROMIUM_LOCALES_DIR")
115+
if [ -z "$CURRENT_CHROMIUM_LOCALES_DIR" ] || [ ! -d "$CURRENT_CHROMIUM_LOCALES_DIR" ]; then
116+
CURRENT_CHROMIUM_DIR="$(dirname "$(find ./dist/.local-browsers -type f -iname 'chrome-headless-shell')")"
117+
else
118+
CURRENT_CHROMIUM_DIR=$(dirname "$CURRENT_CHROMIUM_LOCALES_DIR")
119+
fi
116120
CURRENT_CHROMIUM_VERSION=$(basename "$CURRENT_CHROMIUM_DIR")
117121

118122
if [ -z "$CURRENT_CHROMIUM_DIR" ] || [ ! -d "$CURRENT_CHROMIUM_DIR" ]; then
@@ -157,12 +161,14 @@ if [ -z "$CURRENT_CHROMIUM_DIR" ] || [ ! -d "$CURRENT_CHROMIUM_DIR" ]; then
157161
exit 1
158162
fi
159163

160-
echo " 🧹 Removing unused locales from Playwright ..."
161-
echo
162-
163-
# Find and remove unused locale files, but keep en-US.pak and required files
164-
find "$CURRENT_CHROMIUM_LOCALES_DIR" -type f ! -name "en-US.pak" -delete || true
165-
164+
if [ -z $CURRENT_CHROMIUM_LOCALES_DIR ] || [ ! -d "$CURRENT_CHROMIUM_LOCALES_DIR" ]; then
165+
echo " 🍏 Skipping locale cleanup as locales directory not found."
166+
else
167+
echo " 🧹 Removing unused locales from Playwright ..."
168+
echo
169+
# Find and remove unused locale files, but keep en-US.pak and required files
170+
find "$CURRENT_CHROMIUM_LOCALES_DIR" -type f ! -name "en-US.pak" -delete || true
171+
fi
166172
# Create playwright directory and copy contents (not the directory itself)
167173
mkdir -p "dist/playwright"
168174
cp -R "$CURRENT_CHROMIUM_DIR"/* "dist/playwright/" || { echo " ❌ Failed to copy Playwright.";echo;exit 1; }

0 commit comments

Comments
 (0)