Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit 3632997

Browse files
committed
Initialize repo
Signed-off-by: Timon Wong <timon86.wang@gmail.com>
0 parents  commit 3632997

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tmp/
2+
dist/
3+
manifest.json

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# shellcheck-m1
2+
3+
Sync homebrew'ed Apple M1 shellcheck build.

download.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
SHELLCHECK_REPO=ghcr.io/homebrew/core/shellcheck
6+
SHELLCHECK_VERSION=0.8.0
7+
8+
mkdir -p tmp
9+
10+
echo "Retrieving shellcheck image manifest"
11+
crane manifest "${SHELLCHECK_REPO}:${SHELLCHECK_VERSION}" > tmp/manifests.json
12+
13+
# Extract the actual
14+
DIGEST_VERSION=$(jq -r '[ .manifests[] | select ( .platform.os == "darwin" and .platform.architecture == "arm64" ) ] | reverse | .[0].digest' < tmp/manifests.json)
15+
16+
echo "Downloading shellcheck image from ${SHELLCHECK_REPO}@${DIGEST_VERSION}..."
17+
crane pull "${SHELLCHECK_REPO}@${DIGEST_VERSION}" tmp/shellcheck-image.tar
18+
19+
pushd tmp || exit 1
20+
echo "Extracting shellcheck image..."
21+
rm -rf layers && mkdir layers
22+
tar xvzf shellcheck-image.tar -C layers
23+
24+
LAYER=$(jq -r '.[0].Layers[0]' < layers/manifest.json)
25+
popd
26+
27+
mkdir -p dist/
28+
cp "tmp/layers/${LAYER}" "dist/shellcheck-${SHELLCHECK_VERSION}.tar.gz"
29+
30+
echo "dist/shellcheck-${SHELLCHECK_VERSION}.tar.gz"
31+
32+
# At last, upload the artifact :)

0 commit comments

Comments
 (0)