Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/typst/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "typst",
"version": "1.0.6",
"version": "1.0.7",
"name": "Typst (via Github Releases)",
"documentationURL": "http://github.com/devcontainers-extra/features/tree/main/src/typst",
"description": "Typst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use.",
Expand Down
24 changes: 22 additions & 2 deletions src/typst/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,34 @@ set -e
# of the script
ensure_nanolayer nanolayer_location "v0.5.4"

# detect architecture
architecture="$(uname -m)"
case ${architecture} in
x86_64 | amd64)
arch="x86_64"
;;
aarch64 | arm64)
arch="aarch64"
;;
*)
echo "(!) Architecture ${architecture} is not supported by the typst feature"
exit 1
;;
esac

# target expected release asset via arch-driven release triple
asset_regex="^typst-${arch}-unknown-linux-(gnu|musl)\\.tar\\.(gz|xz)$"

# only consider stable "vX.Y.Z" tags
# pre-release tags (v0.15.0-rc.1) and legacy date based tags (v23-03-28) are deliberately ignored
release_tag_regex='^v[0-9]+\.[0-9]+\.[0-9]+$'

$nanolayer_location \
install \
devcontainer-feature \
"ghcr.io/devcontainers-extra/features/gh-release:1.0.25" \
--option repo='typst/typst' --option binaryNames='typst' --option version="$VERSION"
--option repo='typst/typst' --option binaryNames='typst' --option version="$VERSION" --option assetRegex="$asset_regex" --option releaseTagRegex="$release_tag_regex"



echo 'Done!'

10 changes: 9 additions & 1 deletion test/typst/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
"features": {
"typst": {}
}
},
"test_specific_version": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"typst": {
"version": "0.13.0"
}
}
}
}
}
9 changes: 9 additions & 0 deletions test/typst/test_specific_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

source dev-container-features-test-lib

check "typst version is equal to 0.13.0" sh -c "typst --version | grep '0.13.0'"

reportResults
Loading