organise repo
This commit is contained in:
parent
345c1b592e
commit
b03962ec0a
7 changed files with 7 additions and 117 deletions
11
scripts/bakeimgs
Executable file
11
scripts/bakeimgs
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# TODO: write this as a Makefile maybe?
|
||||
|
||||
# ===== Configuration ===== #
|
||||
IMGS_DIR="imgs"
|
||||
BAKE_DIR="bake"
|
||||
# ========================= #
|
||||
|
||||
mkdir -p "$BAKE_DIR"
|
||||
magick -background '#000000' -size 100x100 "$IMGS_DIR/mirror-icon.svg" "$BAKE_DIR/mirror-icon.png"
|
||||
59
scripts/serve
Executable file
59
scripts/serve
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env bash
|
||||
# Required Binaries:
|
||||
# | simple-http-server
|
||||
# | sass
|
||||
|
||||
# ===== Configuration ===== #
|
||||
ADDR="127.0.0.1" # bind address
|
||||
PORT="8000" # bind port
|
||||
WEBROOT="www" # root web directory
|
||||
USE_INDEX=true
|
||||
NO_CACHE=true
|
||||
declare -a SRV_ARGS=()
|
||||
|
||||
SCSS_PATH="$WEBROOT/scss"
|
||||
CSS_PATH="$WEBROOT/css"
|
||||
# ========================= #
|
||||
|
||||
# ===== Local State ===== #
|
||||
SASS_PID=
|
||||
# ======================= #
|
||||
|
||||
# function cleanup {
|
||||
# if [[ -n "$SASS_PID" ]]; then
|
||||
# kill "$SASS_PID"
|
||||
# fi
|
||||
# }
|
||||
|
||||
# Watch .sass/.scss files and compile on change
|
||||
# function watch_scss {
|
||||
# # watch format "SCSS_PATH:OUT_PATH"
|
||||
# sass --watch "$SCSS_PATH:$CSS_PATH"
|
||||
# }
|
||||
|
||||
function host {
|
||||
local args=( "$@" )
|
||||
# Apply Flags
|
||||
if [[ "$NO_CACHE" == true ]]; then
|
||||
args+=("--nocache")
|
||||
fi
|
||||
if [[ "$USE_INDEX" == true ]]; then
|
||||
args+=("--index")
|
||||
fi
|
||||
|
||||
# Apply Options
|
||||
args+=(--ip "$ADDR" --port "$PORT")
|
||||
|
||||
simple-http-server "${args[@]}" "$@" -- "$WEBROOT"
|
||||
}
|
||||
|
||||
# trap cleanup EXIT
|
||||
set -ueo pipefail
|
||||
set -x
|
||||
|
||||
# auto compile scss changes
|
||||
# watch_scss &
|
||||
# SASS_PID=$!
|
||||
|
||||
# host dev server
|
||||
host "${SRV_ARGS[@]}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue