...
This commit is contained in:
parent
d1571c0b2a
commit
6eaaf873e4
40
env.sh
40
env.sh
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
export NAME='threefoldio'
|
export NAME='threefoldio'
|
||||||
|
|
||||||
SOURCE=${BASH_SOURCE[0]}
|
SOURCE=${BASH_SOURCE[0]}
|
||||||
@ -42,7 +43,7 @@ if [[ ! -f "$HOME/hero/bin/tailwindcss" ]]; then
|
|||||||
pushd /tmp
|
pushd /tmp
|
||||||
rm -f $ASSET
|
rm -f $ASSET
|
||||||
rm -f tailwindcss
|
rm -f tailwindcss
|
||||||
curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/${ASSET}"
|
curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/${ASSET}"
|
||||||
|
|
||||||
FILE_SIZE=$(get_file_size "$ASSET")
|
FILE_SIZE=$(get_file_size "$ASSET")
|
||||||
if [[ $FILE_SIZE -lt 20000000 ]]; then
|
if [[ $FILE_SIZE -lt 20000000 ]]; then
|
||||||
@ -59,6 +60,8 @@ if [[ ! -f "$HOME/hero/bin/tailwindcss" ]]; then
|
|||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Zola version and platform-specific binaries are handled in the install functions below
|
||||||
check_zola() {
|
check_zola() {
|
||||||
if command -v zola &> /dev/null; then
|
if command -v zola &> /dev/null; then
|
||||||
echo "Zola is already installed."
|
echo "Zola is already installed."
|
||||||
@ -88,12 +91,37 @@ install_zola_arch() {
|
|||||||
# Function to install Zola on macOS
|
# Function to install Zola on macOS
|
||||||
install_zola_macos() {
|
install_zola_macos() {
|
||||||
echo "Installing Zola on macOS..."
|
echo "Installing Zola on macOS..."
|
||||||
if command -v brew &> /dev/null; then
|
ZOLA_VERSION="v0.18.0"
|
||||||
brew install zola
|
|
||||||
|
# Determine architecture
|
||||||
|
if [[ "$(uname -m)" == "arm64" ]]; then
|
||||||
|
ZOLA_ARCH="aarch64"
|
||||||
else
|
else
|
||||||
echo "Homebrew is not installed. Please install Homebrew first."
|
ZOLA_ARCH="x86_64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ZOLA_FILE="zola-${ZOLA_VERSION}-${ZOLA_ARCH}-apple-darwin.tar.gz"
|
||||||
|
ZOLA_URL="https://github.com/getzola/zola/releases/download/${ZOLA_VERSION}/${ZOLA_FILE}"
|
||||||
|
|
||||||
|
echo "Downloading Zola ${ZOLA_VERSION} for ${ZOLA_ARCH}..."
|
||||||
|
pushd /tmp
|
||||||
|
curl -sLO "${ZOLA_URL}"
|
||||||
|
|
||||||
|
# Check file size (should be around 8-9MB)
|
||||||
|
FILE_SIZE=$(get_file_size "$ZOLA_FILE")
|
||||||
|
if [[ $FILE_SIZE -lt 7000000 ]]; then
|
||||||
|
echo "Error: Downloaded file size is less than 7MB, download may be incomplete."
|
||||||
|
rm "$ZOLA_FILE"
|
||||||
|
popd
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Extract and install
|
||||||
|
tar -xzf "$ZOLA_FILE"
|
||||||
|
chmod +x zola
|
||||||
|
mv zola "$HOME/hero/bin/"
|
||||||
|
rm "$ZOLA_FILE"
|
||||||
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! check_zola; then
|
if ! check_zola; then
|
||||||
@ -131,6 +159,6 @@ fi
|
|||||||
# Compile tailwindcss for prod & build project
|
# Compile tailwindcss for prod & build project
|
||||||
echo "Compiling tailwindcss and building zola project..."
|
echo "Compiling tailwindcss and building zola project..."
|
||||||
rm -rf public static/css
|
rm -rf public static/css
|
||||||
|
|
||||||
|
set +e
|
||||||
tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user