Browse Source
Once again, it was a small repo that didn't make sense with a monorepo. Signed-off-by: Gavin Howard <gavin@yzena.com>afl_persistent_mode
5 changed files with 176 additions and 4 deletions
@ -0,0 +1,88 @@
|
||||
#! /bin/bash |
||||
# |
||||
# ***** BEGIN LICENSE BLOCK ***** |
||||
# |
||||
# Copyright 2017-2022 Yzena Tech |
||||
# |
||||
# Licensed under the Yzena Network License, Version 0.1 (the "Yzena Network |
||||
# License" or "YNL"). You may not use this file except in compliance with the |
||||
# Yzena Network License. |
||||
# |
||||
# You may obtain a copy of the Yzena Network License at |
||||
# |
||||
# https://yzena.com/yzena-network-license/ |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the Yzena Network License is distributed under the |
||||
# following disclaimer: |
||||
# |
||||
# As far as the law allows, this software comes as is, without any |
||||
# warranty or condition, and no contributor will be liable to anyone for |
||||
# any damages related to this software or this license, under any kind of |
||||
# legal claim. |
||||
# |
||||
# ****** END LICENSE BLOCK ****** |
||||
# |
||||
|
||||
usage() { |
||||
printf 'usage: %s <build_directory> <docs_directory>\n' "$0" |
||||
exit 1 |
||||
} |
||||
|
||||
compress() { |
||||
f="$1" |
||||
zopfli "$f" --stdout > "$f.gz" |
||||
} |
||||
|
||||
export -f compress |
||||
|
||||
set -e |
||||
|
||||
script="$0" |
||||
scriptdir=$(dirname "$script") |
||||
|
||||
if [ "$#" -ge 1 ]; then |
||||
build_dir="$1" |
||||
shift |
||||
else |
||||
usage |
||||
fi |
||||
|
||||
if [ "$#" -ge 1 ]; then |
||||
docs_dir="$1" |
||||
shift |
||||
else |
||||
usage |
||||
fi |
||||
|
||||
if [ -f "$scriptdir/../purgecss.config.js" ]; then |
||||
printf '\nPurging CSS...' |
||||
cp "$scriptdir/../purgecss.config.js" "$docs_dir" |
||||
npx purgecss -c "purgecss.config.js" -o "$build_dir/_static" |
||||
printf 'Done\n' |
||||
fi |
||||
|
||||
exts="html |
||||
css |
||||
js |
||||
ttf |
||||
woff2 |
||||
atom |
||||
stl |
||||
xml |
||||
svg |
||||
eot |
||||
ico |
||||
gaml |
||||
json" |
||||
|
||||
s="" |
||||
|
||||
for t in $exts; do |
||||
temp=$(find $build_dir -type f -name "*.$t") |
||||
if [ "$temp" != "" ]; then |
||||
s=$(printf '%s\n%s' "$temp" "$s") |
||||
fi |
||||
done |
||||
|
||||
printf '%s\n' "$s" | parallel --progress --eta -j$CORES compress |
@ -0,0 +1,51 @@
|
||||
#! /bin/bash |
||||
# |
||||
# ***** BEGIN LICENSE BLOCK ***** |
||||
# |
||||
# Copyright 2017-2022 Yzena Tech |
||||
# |
||||
# Licensed under the Yzena Network License, Version 0.1 (the "Yzena Network |
||||
# License" or "YNL"). You may not use this file except in compliance with the |
||||
# Yzena Network License. |
||||
# |
||||
# You may obtain a copy of the Yzena Network License at |
||||
# |
||||
# https://yzena.com/yzena-network-license/ |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the Yzena Network License is distributed under the |
||||
# following disclaimer: |
||||
# |
||||
# As far as the law allows, this software comes as is, without any |
||||
# warranty or condition, and no contributor will be liable to anyone for |
||||
# any damages related to this software or this license, under any kind of |
||||
# legal claim. |
||||
# |
||||
# ****** END LICENSE BLOCK ****** |
||||
# |
||||
|
||||
usage() { |
||||
printf 'usage: %s <source_directory> <build_directory\n' "$0" |
||||
exit 1 |
||||
} |
||||
|
||||
set -e |
||||
|
||||
script="$0" |
||||
scriptdir=$(dirname "$script") |
||||
|
||||
if [ "$#" -ge 1 ]; then |
||||
source_dir="$1" |
||||
shift |
||||
else |
||||
usage |
||||
fi |
||||
|
||||
if [ "$#" -ge 1 ]; then |
||||
build_dir="$1" |
||||
shift |
||||
else |
||||
usage |
||||
fi |
||||
|
||||
cp -r "$source_dir"/_static/* "$build_dir/_static" |
@ -0,0 +1,37 @@
|
||||
#! /bin/sh |
||||
# |
||||
# ***** BEGIN LICENSE BLOCK ***** |
||||
# |
||||
# Copyright 2017-2022 Yzena Tech |
||||
# |
||||
# Licensed under the Yzena Network License, Version 0.1 (the "Yzena Network |
||||
# License" or "YNL"). You may not use this file except in compliance with the |
||||
# Yzena Network License. |
||||
# |
||||
# You may obtain a copy of the Yzena Network License at |
||||
# |
||||
# https://yzena.com/yzena-network-license/ |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the Yzena Network License is distributed under the |
||||
# following disclaimer: |
||||
# |
||||
# As far as the law allows, this software comes as is, without any |
||||
# warranty or condition, and no contributor will be liable to anyone for |
||||
# any damages related to this software or this license, under any kind of |
||||
# legal claim. |
||||
# |
||||
# ****** END LICENSE BLOCK ****** |
||||
# |
||||
|
||||
script="$0" |
||||
scriptdir=$(dirname "$script") |
||||
|
||||
if [ "$#" -gt 0 ]; then |
||||
builddir="$1" |
||||
shift |
||||
else |
||||
builddir="$scriptdir/../../../build" |
||||
fi |
||||
|
||||
python -m http.server --directory "$builddir/docs/sphinx/" |
Loading…
Reference in new issue