devcontainer: Support arch other than linux-x64
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
"postCreateCommand": "bash -lc \"set -euo pipefail; corepack enable; mkdir -p ~/.local/bin; curl -fsSL https://github.com/formatjs/formatjs/releases/download/formatjs_cli_v1.1.0/formatjs_cli-linux-x64 -o ~/.local/bin/formatjs; chmod +x ~/.local/bin/formatjs; pnpm install --ignore-scripts\"",
|
||||
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
||||
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
|
||||
24
.devcontainer/post-create.sh
Normal file
24
.devcontainer/post-create.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
corepack enable
|
||||
mkdir -p ~/.local/bin
|
||||
|
||||
platform="$(uname -s)-$(uname -m)"
|
||||
formatjs_url=""
|
||||
|
||||
case "$platform" in
|
||||
Linux-x86_64)
|
||||
formatjs_url="https://github.com/formatjs/formatjs/releases/download/formatjs_cli_v1.1.0/formatjs_cli-linux-x64"
|
||||
;;
|
||||
Darwin-arm64)
|
||||
formatjs_url="https://github.com/formatjs/formatjs/releases/download/formatjs_cli_v1.1.0/formatjs_cli-darwin-arm64"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -n "$formatjs_url" ]]; then
|
||||
curl -fsSL "$formatjs_url" -o ~/.local/bin/formatjs
|
||||
chmod +x ~/.local/bin/formatjs
|
||||
fi
|
||||
|
||||
pnpm install --ignore-scripts
|
||||
Reference in New Issue
Block a user