Make build script NixOS-compatible
This commit is contained in:
parent
57ac6d9387
commit
c9b9430d4f
1 changed files with 12 additions and 3 deletions
15
build.sh
15
build.sh
|
@ -1,3 +1,12 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
hugo
|
SCRIPT_DIR=`dirname "$0"`
|
||||||
#find public -name '*.html' -type f -exec tidy --quiet yes --drop-empty-elements no --hide-comments yes -mq '{}' \; &> /dev/null
|
if command -v nix-shell &> /dev/null; then
|
||||||
|
# If in NixOS use shell.nix
|
||||||
|
nix-shell --pure $SCRIPT_DIR/shell.nix --run "cd $SCRIPT_DIR && hugo"
|
||||||
|
else
|
||||||
|
# Otherwise use global hugo
|
||||||
|
DIR=$PWD
|
||||||
|
cd $SCRIPT_DIR
|
||||||
|
hugo
|
||||||
|
cd $DIR
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue