Files
jcutmirror/cached-restore.sh
2024-02-16 13:11:30 +08:00

17 lines
635 B
Bash

#!/bin/bash
md5sum yarn.lock || true
md5sum node_modules/yarn.lock || true
if cmp -s "yarn.lock" "node_modules/yarn.lock"; then
echo "yarn.lock did not change, skipping install"
else
echo "yarn.lock changed, reinstalling packages"
yarn config set registry https://mirrors.jcut.edu.cn/npm
yarn config set sharp_binary_host https://npmmirror.com/mirrors/sharp
yarn config set sharp_libvips_binary_host https://npmmirror.com/mirrors/sharp-libvips
yarn install --frozen-lockfile
sed -i 's/fonts.googleapis.com/fonts.loli.net/g' node_modules/gatsby-plugin-webfonts/modules/google.js
cp yarn.lock node_modules/yarn.lock
fi