snapshot of eee7b5cfc0776c68816d7fdaa8af9d7a0e0da2e6 Annotations about the code that implements koment.

editors/vscode/package-vsix.sh

1 #!/usr/bin/env bash
2 # Usage: package-vsix.sh <version> <archive-directory> <output-directory>
3 #
4 # Builds one VSIX per platform carrying the released koment binary for that
5 # platform, plus a universal VSIX that carries none. Archives are the canonical
6 # release artifacts and are verified against the release checksum manifest
7 # before anything is packaged (ADR 0109, ADR 0113).
8 set -euo pipefail
9
10 version=${1:?version}
11 archives=$(cd "${2:?archive directory}" && pwd)
12 output=${3:?output directory}
13
14 extension=$(cd "$(dirname "$0")" && pwd)
15 repository=$(cd "$extension/../.." && pwd)
16 vsce="$extension/node_modules/.bin/vsce"
17 manifest="$archives/koment_${version}_checksums.txt"
18
19 mkdir -p "$output"
20 output=$(cd "$output" && pwd)
21
22 cp "$repository/LICENSE" "$extension/LICENSE"
23 cp "$repository/internal/ui/assets/koment-logo.png" "$extension/icon.png"
24
25 verify() {
26 local archive=$1
27 (
28 cd "$archives"
29 if command -v sha256sum >/dev/null; then
30 grep " ${archive}\$" "$manifest" | sha256sum -c -
31 else
32 grep " ${archive}\$" "$manifest" | shasum -a 256 -c -
33 fi
34 )
35 }
36
37 # vsce target -> koment archive platform. Every koment archive has exactly one
38 # VS Code target, so a platform that stops being built stops being packaged.
39 targets="linux-x64:linux_amd64 linux-arm64:linux_arm64 darwin-x64:darwin_amd64 darwin-arm64:darwin_arm64 win32-x64:windows_amd64 win32-arm64:windows_arm64"
40
41 for pair in $targets; do
42 target=${pair%%:*}
43 platform=${pair##*:}
44
45 rm -rf "$extension/bin"
46 mkdir -p "$extension/bin"
47
48 case "$platform" in
49 windows_*)
50 archive="koment_${version}_${platform}.zip"
51 verify "$archive"
52 unzip -q -o "$archives/$archive" koment.exe -d "$extension/bin"
53 ;;
54 *)
55 archive="koment_${version}_${platform}.tar.gz"
56 verify "$archive"
57 tar -xzf "$archives/$archive" -C "$extension/bin" koment
58 chmod +x "$extension/bin/koment"
59 ;;
60 esac
61
62 (cd "$extension" && "$vsce" package --target "$target" \
63 --out "$output/koment-vscode_${version}_${target}.vsix")
64 done
65
66 rm -rf "$extension/bin"
67 (cd "$extension" && "$vsce" package --out "$output/koment-vscode_${version}.vsix")
68
69 rm -f "$extension/LICENSE" "$extension/icon.png"
70 ls -1 "$output"

Find an annotation

Search file paths, rationale, kinds, and authors.

moveEnter openEsc close