Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: check for avx2 processor feature when trying to run bun #920

Merged
merged 7 commits into from
May 29, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions scripts/styles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ OUTPUT_STYLECSS=internal/view/assets/css/style.css
INPUT_ARCHIVECSS=internal/view/assets/less/archive.less
OUTPUT_ARCHIVECSS=internal/view/assets/css/archive.css

# Detect support of avx2

if [ -x "$(command -v bun)" ]; then
Monirzadeh marked this conversation as resolved.
Show resolved Hide resolved
if grep -q avx2 /proc/cpuinfo; then
BUN="bun"
else
BUN="sde -chip-check-disable -- bun"
echo "Your CPU does not support avx2 so we use sde, for more information please look at https://github.com/oven-sh/bun/issues/762#issuecomment-1186505847"
fi
fi

# Use bun is installled
if [ -x "$(command -v bun)" ]; then
bun install
bun x prettier internal/view/ --write
bun x lessc $INPUT_STYLECSS $OUTPUT_STYLECSS
bun x lessc $INPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS
bun x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_STYLECSS $OUTPUT_STYLECSS
bun x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS
$BUN install
$BUN x prettier internal/view/ --write
$BUN x lessc $INPUT_STYLECSS $OUTPUT_STYLECSS
$BUN x lessc $INPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS
$BUN x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_STYLECSS $OUTPUT_STYLECSS
$BUN x clean-css-cli $CLEANCSS_OPTS -o $OUTPUT_ARCHIVECSS $OUTPUT_ARCHIVECSS
exit 0
fi

Expand Down
Loading