AtlatestRepositorysigil-site
sigil-site / treepublish.sh
1
#!/usr/bin/env bash2
set -euo pipefail4
# Publish the Sigil website to Codeberg Pages5
#6
# Usage: ./publish.sh [OPTIONS]7
#8
# Options:9
# --local Build only, don't commit/push10
# --serve After building, serve locally (implies --local)11
# --port PORT Port for local server (default: 8000)12
# --skip-build Skip building libraries (use existing build artifacts)13
# --with-repl Force-build the WASM web REPL (on by default for a production14
# publish; use this to also build it under --local)15
# --skip-repl Skip the WASM web REPL build (explicit opt-out; NOT recommended16
# for a production publish — it ships a possibly-stale REPL)17
#18
# The REPL build needs zig (auto-detected from ~/.sigil/toolchain/zig) and19
# wasm-opt/Binaryen (on Guix: run under `guix shell binaryen`). A production20
# publish builds it by default so the live REPL never silently goes stale.21
#22
# Environment:23
# SIGIL Path to sigil binary (default: ~/.sigil/bin/sigil)24
# PARENT_DIR Parent directory where sibling repos live (default: ..)25
# CODEBERG_USER Codeberg username for HTTPS push auth (default: daviwil)26
# CODEBERG_TOKEN When set, uses HTTPS for git operations instead of SSH27
#28
# This script:29
# 1. Ensures the sigil monorepo is present and built30
# 2. Clones/fetches all extracted core library repos31
# 3. Builds each library so API doc JSON is generated32
# 4. Builds the WASM web REPL (default for a production publish; --skip-repl to opt out)33
# 5. Assembles a combined lib directory for with-api-docs34
# 6. Builds the site35
# 7. Optionally deploys to Codeberg Pages37
LOCAL_ONLY=false38
SERVE=false39
PORT=800040
SKIP_BUILD=false41
WITH_REPL="" # empty = decide after parsing: a production publish builds the REPL, --local skips it43
while [[ $# -gt 0 ]]; do44
case $1 in45
--local)46
LOCAL_ONLY=true47
shift48
;;49
--serve)50
LOCAL_ONLY=true51
SERVE=true52
shift53
;;54
--port)55
PORT="$2"56
shift 257
;;58
--skip-build)59
SKIP_BUILD=true60
shift61
;;62
--with-repl)63
WITH_REPL=true64
shift65
;;66
--skip-repl)67
WITH_REPL=false68
shift69
;;70
*)71
echo "Unknown option: $1"72
echo "Usage: $0 [--local] [--serve] [--port PORT] [--skip-build] [--with-repl] [--skip-repl]"73
exit 174
;;75
esac76
done78
# The web REPL is part of a PRODUCTION publish by default, so a real deploy can79
# never silently ship a stale REPL wasm. (It did: usesigil.org sat at 0.17.380
# while the rest of the site read 0.17.6, because --with-repl was an easy-to-81
# forget opt-in.) A production publish now BUILDS the REPL unless --skip-repl is82
# passed explicitly; local dev previews (--local) skip it by default for fast83
# iteration (opt in with --with-repl). Either way the choice is explicit.84
if [[ -z "$WITH_REPL" ]]; then85
if [[ "$LOCAL_ONLY" == "true" ]]; then WITH_REPL=false; else WITH_REPL=true; fi86
fi88
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"89
cd "$SCRIPT_DIR"91
SIGIL="${SIGIL:-$HOME/.sigil/bin/sigil}"92
PARENT_DIR="${PARENT_DIR:-$(cd "$SCRIPT_DIR/.." && pwd)}"93
PUBLIC_DIR="$SCRIPT_DIR/public"94
COMBINED_LIB="$SCRIPT_DIR/build/combined-lib"96
# Pages deployment target (usesigil.org is hosted from sigil monorepo pages branch)97
# Use HTTPS with token auth when CODEBERG_TOKEN is set (e.g. in CI),98
# otherwise use SSH (local development)99
if [[ -n "${CODEBERG_TOKEN:-}" ]]; then100
CODEBERG_USER="${CODEBERG_USER:-daviwil}"101
PAGES_REPO_URL="https://${CODEBERG_USER}:${CODEBERG_TOKEN}@codeberg.org/sigil/sigil.git"102
else103
PAGES_REPO_URL="[email protected]:sigil/sigil.git"104
fi105
PAGES_BRANCH="pages"106
DOMAIN="usesigil.org"108
# ---------------------------------------------------------------------------109
# Core libraries whose API docs appear on usesigil.org110
# ---------------------------------------------------------------------------112
# Monorepo packages (built from ../sigil) that need a _pkg manifest113
# generated when their custom tasks: skip the default copy-package-docs114
# step. The browser/WASM bridge packages all stage JS assets through115
# custom tasks, so without this list their package pages never render116
# on the site even though their module .json docs generate fine.117
MONOREPO_PACKAGES=(118
sigil-cli119
sigil-run120
sigil-browser121
sigil-wasm-runtime122
sigil-wasm-dom123
sigil-wasm-net124
sigil-wasm-canvas2d125
sigil-wasm-gl126
)128
# Extracted repos (cloned as peer directories and built individually).129
# Multi-package repos: sigil-lang (sigil-lib + sigil-stdlib),130
# sigil-build (sigil-package + sigil-deps + sigil-build),131
# sigil-test (sigil-test + sigil-test-runner).132
EXTRACTED_REPOS=(133
sigil-lang sigil-build134
sigil-args sigil-ansi sigil-version sigil-docs sigil-git sigil-socket135
sigil-log sigil-json sigil-http sigil-crypto sigil-tls sigil-sqlite136
sigil-store sigil-lsp sigil-mcp sigil-repl sigil-nrepl sigil-ffi137
sigil-format sigil-hooks sigil-test138
sigil-peg sigil-sxml sigil-markdown sigil-css sigil-fp sigil-match139
sigil-r7rs sigil-transducers sigil-web sigil-web-client sigil-yaml sigil-later140
# Core, general-purpose libraries added by the 2026-07 completeness audit.141
# These are published sigil/* library packages that were missing from the142
# docs site. (SaaS/API-client packages: forgejo, caldav, jmap, discourse,143
# postmark, ses, lemonsqueezy, telegram, twitch, youtube, wise, plus the144
# graphics/audio/game stack, are intentionally excluded; see the audit note.)145
# sigil-rss was also identified but is NOT release-ready (no tags, its146
# package.sgl lacks the required `sigil:` field and fails to build), so it147
# is held back until it is fixed and released. sigil-ledger was evaluated148
# and intentionally left out as too specialized.149
sigil-websocket sigil-oauth sigil-jwt sigil-irc sigil-xmpp150
sigil-org sigil-tui151
)153
# ---------------------------------------------------------------------------154
# Helper functions155
# ---------------------------------------------------------------------------157
info() { echo "=== $* ==="; }158
warn() { echo "WARNING: $*"; }159
die() { echo "ERROR: $*" >&2; exit 1; }161
repo_url() {162
local name="$1"163
if [[ -n "${CODEBERG_TOKEN:-}" ]]; then164
echo "https://codeberg.org/sigil/${name}.git"165
else166
echo "[email protected]:sigil/${name}.git"167
fi168
}170
ensure_repo() {171
local name="$1"172
local dir="$PARENT_DIR/$name"174
if [[ -d "$dir" ]]; then175
echo " Fetching $name..."176
git -C "$dir" fetch --quiet --tags 2>/dev/null || true177
else178
echo " Cloning $name..."179
git clone --quiet "$(repo_url "$name")" "$dir"180
fi181
}183
build_extracted_repo() {184
local name="$1"185
local dir="$PARENT_DIR/$name"187
if [[ ! -d "$dir" ]]; then188
warn "$name directory not found, skipping"189
return190
fi192
echo " Building $name..."193
cd "$dir"195
# Ensure deps are installed196
if [[ ! -d ".sigil/deps" ]]; then197
$SIGIL deps install > /dev/null 2>&1 || true198
fi200
# Build with --force to ensure JSON docs are generated.201
# The build may error after compilation due to sigil-lib resolution;202
# that's OK since compilation (and JSON generation) still succeeds.203
$SIGIL build --force > /dev/null 2>&1 || true205
cd "$SCRIPT_DIR"206
}208
# Merge a lib directory into the combined lib.209
# Copies .sgb, .json, and _pkg files. First source wins on conflicts.210
merge_lib() {211
local src="$1"212
local label="$2"214
if [[ ! -d "$src" ]]; then215
warn "$label lib dir not found: $src"216
return217
fi219
# Copy .sgb and .json files, preserving directory structure220
find "$src" -type f \( -name "*.sgb" -o -name "*.json" \) | while read -r file; do221
local rel="${file#$src/}"222
local dest="$COMBINED_LIB/$rel"223
if [[ ! -f "$dest" ]]; then224
mkdir -p "$(dirname "$dest")"225
cp "$file" "$dest"226
fi227
done229
# Copy _pkg directories (package metadata + docs)230
if [[ -d "$src/_pkg" ]]; then231
find "$src/_pkg" -type f | while read -r file; do232
local rel="${file#$src/}"233
local dest="$COMBINED_LIB/$rel"234
if [[ ! -f "$dest" ]]; then235
mkdir -p "$(dirname "$dest")"236
cp "$file" "$dest"237
fi238
done239
fi240
}242
# Fix package attribution for extracted repos.243
# When a module exists in both the monorepo (as part of sigil-stdlib) and an244
# extracted repo (as its own package), the monorepo .json says package: "sigil-stdlib"245
# but the extracted repo .json says package: "<repo-name>". We want the extracted246
# repo's attribution so the module appears under the correct package on the site.247
fix_extracted_json() {248
local name="$1"249
local src="$PARENT_DIR/$name/build/dev/lib"251
if [[ ! -d "$src" ]]; then252
return253
fi255
# Overwrite .json files in combined-lib where the extracted repo's version256
# has the correct package attribution (package matches the repo name)257
find "$src" -name "*.json" ! -path "*/_pkg/*" | while read -r file; do258
if grep -q "\"package\": \"$name\"" "$file"; then259
local rel="${file#$src/}"260
local dest="$COMBINED_LIB/$rel"261
mkdir -p "$(dirname "$dest")"262
cp "$file" "$dest"263
fi264
done265
}267
# Ensure a _pkg manifest exists for a monorepo package.268
# Some packages have custom tasks: that skip the default copy-package-docs step,269
# so their _pkg manifest is never created. We generate one from package.sgl.270
ensure_pkg_manifest() {271
local name="$1"272
local pkg_dir="$PARENT_DIR/sigil/packages/$name"273
local manifest_dir="$COMBINED_LIB/_pkg/$name"274
local manifest_path="$manifest_dir/manifest.json"276
# Skip if manifest already exists277
if [[ -f "$manifest_path" ]]; then278
return279
fi281
if [[ ! -f "$pkg_dir/package.sgl" ]]; then282
warn "No package.sgl for $name, cannot generate manifest"283
return284
fi286
# Extract version and description from package.sgl287
# Packages may omit version: (inherited from workspace), fall back to workspace version288
local version description289
version=$(grep 'version:' "$pkg_dir/package.sgl" | head -1 | sed 's/.*version: *"\(.*\)".*/\1/' || true)290
if [[ -z "$version" ]]; then291
version=$(grep 'version:' "$PARENT_DIR/sigil/package.sgl" | head -1 | sed 's/.*version: *"\(.*\)".*/\1/' || true)292
fi293
description=$(grep 'description:' "$pkg_dir/package.sgl" | head -1 | sed 's/.*description: *"\(.*\)".*/\1/' || true)295
mkdir -p "$manifest_dir"296
cat > "$manifest_path" <<MANIFEST297
{298
"name": "$name",299
"version": "$version",300
"description": "$description"301
}302
MANIFEST303
echo " Generated manifest for $name"304
}306
# Ensure a _pkg manifest exists for an EXTRACTED repo package.307
# Extracted repos whose package.sgl defines a custom tasks: build task override308
# the default build (which runs copy-package-docs), and if they also ship no309
# docs/ dir they never emit their own _pkg/<name>/manifest.json. Without that310
# manifest, Press's scan-library-docs skips the package entirely: no Libraries311
# sidebar entry and the /docs/lib/<name>/ page 404s (as happened to312
# sigil-crypto, sigil-tls, and sigil-nrepl). This is the same failure mode313
# ensure_pkg_manifest handles for MONOREPO_PACKAGES; generate the manifest from314
# the repo's own package.sgl. The package name is the repo name (matches the315
# convention fix_extracted_json relies on for single-package repos).316
ensure_extracted_pkg_manifest() {317
local name="$1"318
local repo_dir="$PARENT_DIR/$name"319
local pkg_sgl="$repo_dir/package.sgl"320
local build_lib="$repo_dir/build/dev/lib"322
if [[ ! -f "$pkg_sgl" ]]; then323
return324
fi326
local manifest_dir="$COMBINED_LIB/_pkg/$name"327
local manifest_path="$manifest_dir/manifest.json"329
# Skip if a manifest was already merged from the repo's own build output330
if [[ -f "$manifest_path" ]]; then331
return332
fi334
# Only synthesize a manifest when the repo actually built modules attributed335
# to this package. This guards against workspace/multi-package repos (e.g.336
# sigil-lang, whose package.sgl name is the workspace name "sigil-lang" but337
# which ships sigil-stdlib/sigil-lib) and against unbuilt/empty repos --338
# either would otherwise produce a bogus empty package in the sidebar.339
if [[ ! -d "$build_lib" ]]; then340
return341
fi342
if ! grep -rls "\"package\": \"$name\"" "$build_lib" --include='*.json' >/dev/null 2>&1; then343
return344
fi346
local version description347
version=$(grep 'version:' "$pkg_sgl" | head -1 | sed 's/.*version: *"\(.*\)".*/\1/' || true)348
description=$(grep 'description:' "$pkg_sgl" | head -1 | sed 's/.*description: *"\(.*\)".*/\1/' || true)350
mkdir -p "$manifest_dir"351
cat > "$manifest_path" <<MANIFEST352
{353
"name": "$name",354
"version": "$version",355
"description": "$description"356
}357
MANIFEST358
echo " Generated manifest for extracted package $name"359
}361
# ---------------------------------------------------------------------------362
# Step 1: Ensure sigil monorepo is present and built363
# ---------------------------------------------------------------------------365
info "Checking sigil monorepo"367
if [[ ! -d "$PARENT_DIR/sigil" ]]; then368
die "../sigil not found. Clone the sigil monorepo as a peer directory."369
fi371
if [[ "$SKIP_BUILD" != "true" ]]; then372
if [[ ! -d "$PARENT_DIR/sigil/build/dev/lib" ]]; then373
echo " Building monorepo..."374
cd "$PARENT_DIR/sigil"375
$SIGIL build376
cd "$SCRIPT_DIR"377
else378
echo " Monorepo build found."379
fi380
fi382
# ---------------------------------------------------------------------------383
# Step 2: Clone/fetch extracted library repos384
# ---------------------------------------------------------------------------386
info "Ensuring extracted library repos"388
for repo in "${EXTRACTED_REPOS[@]}"; do389
ensure_repo "$repo"390
done392
# ---------------------------------------------------------------------------393
# Step 3: Build extracted libraries394
# ---------------------------------------------------------------------------396
if [[ "$SKIP_BUILD" != "true" ]]; then397
info "Building extracted libraries"399
for repo in "${EXTRACTED_REPOS[@]}"; do400
build_extracted_repo "$repo"401
done402
fi404
# ---------------------------------------------------------------------------405
# Step 3.5: Build web REPL WASM (default for production publishes; --skip-repl to opt out)406
# ---------------------------------------------------------------------------408
if [[ "$WITH_REPL" == "true" ]]; then409
# Auto-detect the sigil-bundled zig so the REPL build works without a manual410
# PATH setup. sigil's pinned zig is cached under the monorepo's tools/zig411
# (populated by scripts/with-zig) and symlinked at ~/.sigil/toolchain/zig —412
# the same toolchain the release build uses. Only look if zig isn't already413
# on PATH.414
if ! command -v zig >/dev/null 2>&1; then415
for zdir in "$HOME/.sigil/toolchain/zig" "${PARENT_DIR:-}/sigil/tools/zig"; do416
if [[ -n "$zdir" && -x "$zdir/zig" ]]; then417
info "Using bundled zig at $zdir"418
export PATH="$zdir:$PATH"419
break420
fi421
done422
fi423
if ! command -v zig >/dev/null 2>&1; then424
die "REPL build requires zig: not on PATH and no bundled zig found at ~/.sigil/toolchain/zig or \$PARENT_DIR/sigil/tools/zig. Install zig, or run the monorepo's scripts/with-zig once to populate the bundled toolchain."425
fi427
# wasm-opt (Binaryen) is required for the --asyncify post-link pass that the428
# monorepo's --config web build runs. Without it that pass is silently429
# skipped and the REPL wasm ships unresolved asyncify.* imports, so it fails430
# to instantiate in the browser ("Import asyncify: module is not an object431
# or function") and the REPL hangs. Fail loudly instead of shipping a broken432
# REPL. On Guix, wasm-opt is not on PATH by default: re-run inside a guix433
# shell (zig is auto-detected, so binaryen is the only thing to add):434
# guix shell binaryen -- ./publish.sh435
if ! command -v wasm-opt >/dev/null 2>&1; then436
die "REPL build requires wasm-opt (Binaryen) for the --asyncify pass, not on PATH. On Guix: guix shell binaryen -- ./publish.sh (zig is auto-detected). To publish WITHOUT the REPL, pass --skip-repl explicitly — but that ships whatever REPL wasm is currently staged, which may be stale."437
fi439
info "Building web REPL (WASM)"441
ensure_repo "sigil-web-repl"442
REPL_SRC="$PARENT_DIR/sigil-web-repl"443
cd "$REPL_SRC"445
# Clean build: the bundle step globs everything under build/web/lib,446
# so orphaned modules from older builds survive incremental rebuilds447
# and ship stale bytecode (March-era v7 match/sxml modules rode along448
# this way and broke those REPL examples on the live site).449
rm -rf build/web451
# Install deps or use redirects to local monorepo452
if [[ -d "$PARENT_DIR/sigil" ]]; then453
REDIR_FILE=$(mktemp)454
cat > "$REDIR_FILE" << 'REDIR_EOF'455
(redirects456
repos: (list457
(for-repo458
url: "codeberg:sigil/sigil"459
use: (from-path dir: "../sigil"))))460
REDIR_EOF461
$SIGIL build --redirects "$REDIR_FILE" --config web462
rm -f "$REDIR_FILE"463
else464
$SIGIL deps install465
$SIGIL build --config web466
fi467
cd "$SCRIPT_DIR"469
# Copy WASM artifacts into site assets470
REPL_BUILD="$REPL_SRC/build/web"471
if [[ -f "$REPL_BUILD/sigil-web-repl.wasm" ]]; then472
echo " Copying WASM artifacts..."473
cp "$REPL_BUILD/sigil-web-repl.wasm" "$SCRIPT_DIR/assets/repl/"474
# The page JS and the wasm are a matched pair: a stale page driving475
# a fresh wasm hung evaluation on the live site (the eval/input ABI476
# plumbing had moved on). Always ship the page from the same build.477
cp "$REPL_BUILD/index.html" "$SCRIPT_DIR/assets/repl/index.html"479
# Generate merged lib.bundle (web-repl modules + extras for REPL examples).480
# generate-web-bundle lets LATER dirs override earlier ones, so the481
# REPL's own lib goes last: it is the coherent, freshly built set,482
# and a stale peer build must never override its core/stdlib483
# bytecode (a v7 sigil/core.sgb from an old sigil-sxml build once484
# shipped over the fresh v9 one and broke the live REPL).485
BUNDLE_DIRS=""486
for peer in sigil-sxml sigil-match; do487
if [[ -d "$PARENT_DIR/$peer/build/dev/lib" ]]; then488
echo " Adding modules from $peer..."489
BUNDLE_DIRS="$BUNDLE_DIRS \"$PARENT_DIR/$peer/build/dev/lib\""490
fi491
done492
BUNDLE_DIRS="$BUNDLE_DIRS \"$REPL_BUILD/lib\""494
echo " Generating lib.bundle..."495
$SIGIL eval "(import (sigil build))496
(let ((n (generate-web-bundle497
output: \"assets/repl/lib.bundle\"498
dirs: (list $BUNDLE_DIRS))))499
(display n)500
(display \" files bundled\n\"))"501
else502
warn "WASM build did not produce sigil-web-repl.wasm"503
fi504
fi506
# ---------------------------------------------------------------------------507
# Step 4: Assemble combined lib directory508
# ---------------------------------------------------------------------------510
info "Assembling combined API docs"512
rm -rf "$COMBINED_LIB"513
mkdir -p "$COMBINED_LIB"515
# Monorepo libs first (primary source)516
merge_lib "$PARENT_DIR/sigil/build/dev/lib" "monorepo"518
# Then extracted repos (only adds modules not already present)519
for repo in "${EXTRACTED_REPOS[@]}"; do520
merge_lib "$PARENT_DIR/$repo/build/dev/lib" "$repo"521
done523
# Fix package attribution for extracted repos whose modules overlap with monorepo524
for repo in "${EXTRACTED_REPOS[@]}"; do525
fix_extracted_json "$repo"526
done528
# Generate _pkg manifests for monorepo packages that lack them529
for pkg in "${MONOREPO_PACKAGES[@]}"; do530
ensure_pkg_manifest "$pkg"531
done533
# Generate _pkg manifests for extracted repos whose custom build tasks skip534
# copy-package-docs (e.g. sigil-crypto, sigil-tls, sigil-nrepl). Without this535
# they never appear in the Libraries sidebar and their pages 404.536
for repo in "${EXTRACTED_REPOS[@]}"; do537
ensure_extracted_pkg_manifest "$repo"538
done540
echo " Combined lib ready."542
# ---------------------------------------------------------------------------543
# Step 5: Build the site544
# ---------------------------------------------------------------------------546
info "Building site"548
# Ensure press and other deps are installed549
if [[ ! -d ".sigil/deps" ]]; then550
echo " Installing site dependencies..."551
$SIGIL deps install552
fi554
# Compile the site explicitly before run. `sigil run`'s auto-compile-hook555
# can produce sub-threshold .sgb stubs in some cases (see sigil-papercut t-2fa9);556
# an explicit `sigil build` produces real bytecode and avoids the failure mode557
# where `(import (sigil-site main))` finds the module but its exports are empty.558
echo " Compiling site sources..."559
$SIGIL build561
# Clear stale output before regenerating. The site build writes pages into562
# public/ but never removes ones that no longer exist, so pages for packages563
# dropped from the arrays (or any renamed/removed content) linger as stale564
# files. Because the deploy step copies public/ verbatim into the fresh pages565
# branch, those stale pages would ship to production on every republish, not566
# just locally. Starting from an empty output tree guarantees public/ reflects567
# exactly the current build.568
rm -rf "$PUBLIC_DIR"570
# Build and run the site571
# -L adds combined-lib to module search paths so Press's load-module-details572
# can find .json doc files for packages not in the site's dependency tree573
$SIGIL -L "$COMBINED_LIB" run -- build575
# Verify576
if [[ ! -d "$PUBLIC_DIR" ]] || [[ ! -f "$PUBLIC_DIR/index.html" ]]; then577
die "Site build failed - public directory missing or incomplete"578
fi580
# ---------------------------------------------------------------------------581
# Step 6: Deploy or serve582
# ---------------------------------------------------------------------------584
if [[ "$LOCAL_ONLY" == "true" ]]; then585
echo ""586
echo "Local build complete! Site is in: $PUBLIC_DIR"588
if [[ "$SERVE" == "true" ]]; then589
echo "Starting local server at http://localhost:$PORT"590
echo "Press Ctrl+C to stop."591
cd "$PUBLIC_DIR"592
python3 -m http.server "$PORT"593
fi594
else595
info "Publishing site to $DOMAIN"597
TEMP_DIR=$(mktemp -d)599
# Initialize a fresh repo with orphan branch600
cd "$TEMP_DIR"601
git init --quiet602
git config user.email "[email protected]"603
git config user.name "Sigil Pages"604
git checkout --orphan "$PAGES_BRANCH"606
# Copy public content607
cp -r "$PUBLIC_DIR"/* "$TEMP_DIR/"609
# Create .domains file for Codeberg Pages610
echo "$DOMAIN" > "$TEMP_DIR/.domains"612
# Commit and force push613
git add -A614
git commit --quiet -m "Update site"615
git remote add origin "$PAGES_REPO_URL"616
echo " Force pushing to $PAGES_BRANCH branch..."617
git push --force origin "$PAGES_BRANCH"619
echo ""620
echo "Done! Site will be available at:"621
echo " https://$DOMAIN/"622
echo " https://$DOMAIN/docs/"624
# Cleanup625
cd "$SCRIPT_DIR"626
rm -rf "$TEMP_DIR"627
fi