Commit 586c94a7 authored by Rob Muhlestein's avatar Rob Muhlestein 👌

save

parent d73df31e
......@@ -38,7 +38,7 @@ sols () {
for i in b03 b02 b01 b00 b0 b1 b2 b3 y o r m v b c g rnd; do
echo -ne $(sol $i)$i" "
done
echo $(kn sol x)x cl ln
echo $(sol x)x cl ln
}
checkdeps () {
......@@ -115,6 +115,17 @@ _watch () {
while true; do _make; sleep 2; done
}
_check () {
local node="$1"
# TODO base mode aware
local uri="http://localhost:3000/$node/"
if [[ -z $node ]]; then
muffet $uri
else
muffet -p $uri
fi
}
_build () {
local data
local maindata
......@@ -372,9 +383,11 @@ _help () {
echo " r[oot]d - changes to KNROOT directory"
echo " r[oot]d - changes to KNROOT directory"
echo " last - prints the last node edited"
echo " mode [MODE] - prints or sets MODE"
echo " b[uild] NODE - builds only the specified NODE"
echo " make - builds anything that has changed"
echo " watch - turns on browser-sync and detects new makes needed"
echo " check [NODE] - check for broken links"
echo " save - git syncs and commits"
echo " rm - interactively removes a specific node"
echo " s[earch]|\? - search for keyword in node name or titles"
......@@ -398,6 +411,7 @@ _help () {
echo
echo "NODE is a lower-case, no space slug at the top level"
echo "TYPE is a class of nodes (ex: \$KNWORK/.kn/ignore/index)"
echo "MODE is [dev|prod] (default: dev)"
echo
echo Environment:
echo
......@@ -417,10 +431,14 @@ case "$1" in
work|wd) shift; cd "$KNWORK"; echo $(sol c)exit$(sol y) when done.$(sol x); exec bash ;;
cd) shift; cd "$KNWORK/$1"; echo $(sol c)exit$(sol y) when done.$(sol x); exec bash ;;
root|rd) shift; cd "$KNROOT"; echo $(sol c)exit$(sol y) when done.$(sol x); exec bash ;;
mode) shift; touch "$KNWORK/.kn/mode";
[[ -n "$1" ]] && echo "$1" >| "$KNWORK/.kn/mode";
head -1 "$KNWORK/.kn/mode" ;;
last) shift; _last "$@" ;;
build|b) shift; _build "$@" ;;
make) shift; _make "$@" ;;
watch) shift; _watch "$@" ;;
check) shift; _check "$@" ;;
save) shift; _save "$@" ;;
rm) shift; _rm "$@" ;;
s|search|\?) shift; _search "$@" ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment