Fresh install script
This guarded Bash script creates a new V2 checkout, installs locked dependencies, runs tests and builds the included documentation. It is an alternative to typing the individual commands, not an OS installer, deployment system or updater for an existing site.
This page embeds a complete script as text; it is not an existing hosted download. A .txt suffix does not change Bash syntax: run it with bash, not by double-clicking it or granting execute permission. Read the script before executing it. Run it as your normal user in a workspace where you may create a directory. It refuses an existing target or a symbolic link, including a broken link, rather than deciding whether its contents are safe to replace.
Prerequisites and scope
Install Git, Node.js 24+ and npm first. Verify their versions in the same shell. You also need normal repository access and internet access for clone/dependency installation. This script never requests a password in an argument or changes GitHub settings.
It follows the repository’s current default branch. For a controlled engine revision, use the manual pinned-checkout sequence in Complete setup before installation rather than treating whatever is latest as an approved production update.
The target is a new child directory in your chosen workspace, not /, a service directory or another site. Quote its argument when it contains spaces. The script runs Bash. On Windows, use an appropriate Bash environment or follow the individual PowerShell commands in Windows macOS and Linux. Do not paste it into PowerShell and expect Bash syntax to work.
Save and inspect the script
Save this as setup-markstack.txt in the parent workspace, not inside a folder you intend to overwrite:
#!/usr/bin/env bash
set -euo pipefail
repo=https://github.com/KineticEnforcer/MarkStackV2.git
target=${1:-MarkStackV2}
command -v git >/dev/null
command -v node >/dev/null
command -v npm >/dev/null
node -e 'if (Number(process.versions.node.split(".")[0]) < 24) { console.error("Node.js 24+ is required"); process.exit(1); }'
if [[ -e "$target" || -L "$target" ]]; then
printf '%s\n' 'Target already exists. Choose a new folder; this script will not overwrite it.' >&2
exit 1
fi
git clone "$repo" "$target"
cd "$target"
npm ci
npm test
npm run build
printf '%s\n' 'Build ready. Run npm run serve here to preview.'
printf '%s\n' 'Optional: npm run editor:create-admin -- --user admin, then npm run editor.'
Run a syntax check and then select a new target:
bash -n setup-markstack.txt
bash setup-markstack.txt ./MarkStackV2
bash -n checks syntax only. It does not prove clone access, dependencies, tests or build success. If ./MarkStackV2 already exists, choose another unused target or inspect that existing checkout manually. Do not delete it merely to make the script continue.
What each stage changes
| Stage | Effect and passing gate |
|---|---|
| Tools | Read versions; Node24+ and every command present |
| Target | Read path state; new unused target |
| Clone | Create checkout; correct repository/revision |
| Install | Replace dependencies; npm exits successfully |
| Tests | Run disposable test work; zero failures |
| Build | Generate default output; build and reader check pass |
With set -e, a failed command stops the sequence before the final success messages. A partial checkout may remain after a later failure. Preserve it and inspect the error; do not repeatedly rerun the script against that same now-existing target.
Preview and finish the setup
After success:
cd MarkStackV2
npm run serve
Use the actual target if you chose a different name. Open the loopback preview URL printed by the server. Check home, a deep page, search, styles, local image and a code-copy control. Stop preview with Ctrl+C when done.
Continue with First site to create useful content. The script deliberately leaves the included documentation in place so you have a baseline. Back it up/review it before replacing it with your own material. Change source and configuration, not generated HTML.
For browser writing, create the first administrator using the hidden prompt and start the separate editor, as explained in Administrator and editor. The script does not create accounts automatically, start background services or expose a listener.
Failures and safe next steps
A missing command fails early: install/select that tool, then check versions again. A clone access error needs the correct account/visibility, not a password embedded in the repository URL. A dependency failure needs its actual npm message and working directory. A test failure should be investigated before declaring the installation usable.
If the checkout is created but installation stops, enter that folder and inspect git status and git rev-parse HEAD. Once you understand the failure, resume the appropriate manual command in the correct checkout rather than bypassing guards or assuming a partial install succeeded.
Verification status
The script’s Bash syntax, Node-version guard and existing-target refusal were checked locally. Its install/test/build sequence was exercised on recovered pinned V2 source: Node.js 24.21.0, locked dependencies and 219 passing tests. That does not claim an unauthenticated public clone from a fresh machine, an OS package installation or a production deployment. Clone visibility/access and the actual remote default branch remain conditions to check on your own machine.