fuzzyworld

fuzzyworld-tools / files / vscode-web / install.sh

install.sh

Blame: the commit that last changed each line · file · history

1758548c 2026-10-27 Pavel Safronov1#!/bin/bash
2# Install VS Code in the browser at apps.fuzzyworld.net/vscode/. Run from the laptop:
3#
4# vscode-web/install.sh build, then upload to dh:apps.fuzzyworld.net/vscode/
5# vscode-web/install.sh --out DIR only build into DIR (for trying it locally)
6#
7# The editor is the vscode-web npm package (VS Code's open-source web build, MIT), pinned below;
8# npm checks the download against the registry's integrity hash. Beside it go index.html and
9# fw-fs/, our read-only file system for code.fuzzyworld.net. The app has no .fuzzyworld.json, so
10# it isn't listed on the apps index; repo pages link to it.
11set -euo pipefail
12cd "$(dirname "$0")"
13VERSION=1.91.1
14HOST=${FW_HOST:-dh}
15out=""
16[ "${1:-}" = --out ] && out=${2:?--out needs a directory}
17
18tmp=$(mktemp -d)
19trap 'rm -rf "$tmp"' EXIT
20( cd "$tmp" && npm pack --silent "vscode-web@$VERSION" >/dev/null && tar xzf "vscode-web-$VERSION.tgz" )
21build=${out:-$tmp/build}
22mkdir -p "$build"
23rsync -a --delete "$tmp/package/dist/" "$build/dist/"
24rsync -a --delete fw-fs/ "$build/fw-fs/"
25cp index.html "$build/index.html"
26echo "built VS Code web $VERSION in $build"
27
28if [ -z "$out" ]; then
29 ssh "$HOST" 'mkdir -p apps.fuzzyworld.net/vscode'
30 rsync -az --delete "$build/" "$HOST:apps.fuzzyworld.net/vscode/"
31 echo "installed: https://apps.fuzzyworld.net/vscode/?repo=<name>"
32fi