@sassywares/skills 0.11.11 → 0.11.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
# 3. Everything resolves against the MAIN checkout, so running any of these
|
|
11
11
|
# from inside a worktree behaves identically.
|
|
12
12
|
#
|
|
13
|
-
# worktree-version:
|
|
13
|
+
# worktree-version: 7
|
|
14
14
|
|
|
15
15
|
set -euo pipefail
|
|
16
16
|
|
|
17
|
-
WT_VERSION="
|
|
17
|
+
WT_VERSION="7"
|
|
18
18
|
WT_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
19
|
|
|
20
20
|
log() { printf '%s\n' "$*"; }
|
|
@@ -372,7 +372,7 @@ _wt_preview_block() {
|
|
|
372
372
|
# section is the answer; with several, nothing is returned rather than guessing which
|
|
373
373
|
# app a checkout is serving.
|
|
374
374
|
wt_preview() {
|
|
375
|
-
local slug="$1" sect="${2:-}" recipe line=""
|
|
375
|
+
local slug="$1" sect="${2:-}" recipe line="" cand count sl port base
|
|
376
376
|
recipe="$(wt_flat | awk -F'\t' -v p="dogfood${WLIB_US}recipe" '$1 == p { print $2; exit }')"
|
|
377
377
|
recipe="${recipe:-.sassywares/dogfood/recipe.md}"
|
|
378
378
|
case "$recipe" in /*) ;; *) recipe="$MAIN/$recipe" ;; esac
|
|
@@ -380,11 +380,18 @@ wt_preview() {
|
|
|
380
380
|
if [ -n "$sect" ]; then line="$(_wt_preview_block "$recipe" "$sect")"; fi
|
|
381
381
|
if [ -z "$line" ]; then line="$(_wt_preview_block "$recipe" "")"; fi
|
|
382
382
|
if [ -z "$line" ]; then
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
383
|
+
# Fall back to the single section that *declares* an address. Counting sections
|
|
384
|
+
# would fail on a recipe with one app and one uncovered surface, which is a
|
|
385
|
+
# perfectly ordinary shape: only the app has somewhere to look.
|
|
386
|
+
count=0; cand=""
|
|
387
|
+
while IFS= read -r sl; do
|
|
388
|
+
[ -n "$sl" ] || continue
|
|
389
|
+
cand="$(_wt_preview_block "$recipe" "$sl")"
|
|
390
|
+
[ -n "$cand" ] || continue
|
|
391
|
+
count=$((count + 1))
|
|
392
|
+
line="$cand"
|
|
393
|
+
done < <(sed -n 's/^## \([^ ]*\).*/\1/p' "$recipe")
|
|
394
|
+
[ "$count" -eq 1 ] || line=""
|
|
388
395
|
fi
|
|
389
396
|
[ -n "$line" ] || return 0
|
|
390
397
|
port=""
|
|
@@ -205,12 +205,17 @@ recipe_lint() {
|
|
|
205
205
|
if (index($0, "-->")) incomment = 0
|
|
206
206
|
next
|
|
207
207
|
}
|
|
208
|
-
# The two inventories are file level: names of surfaces, not a surface.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
208
|
+
# The two inventories are file level: names of surfaces, not a surface. Inside a
|
|
209
|
+
# section they are a mistake — a section states its own answer with **Prove it:**.
|
|
210
|
+
index($0, "**Uncovered:**") || index($0, "**Out of scope:**") {
|
|
211
|
+
if (sec != "") {
|
|
212
|
+
printf "\"**Uncovered:**\" and \"**Out of scope:**\" are file level only — section \"%s\" states its own answer with **Prove it:** none\n", sname
|
|
213
|
+
next
|
|
214
|
+
}
|
|
215
|
+
line = $0
|
|
216
|
+
if (index($0, "**Uncovered:**")) { sub(/^\*\*Uncovered:\*\*[[:space:]]*/, "", line); inventory(line, "unc") }
|
|
217
|
+
else { sub(/^\*\*Out of scope:\*\*[[:space:]]*/, "", line); inventory(line, "oos") }
|
|
218
|
+
next
|
|
214
219
|
}
|
|
215
220
|
index($0, "**Prove it:**") {
|
|
216
221
|
prove = 1
|