This repository was archived by the owner on Aug 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ tmp /
2+ dist /
3+ manifest.json
Original file line number Diff line number Diff line change 1+ # shellcheck-m1
2+
3+ Sync homebrew'ed Apple M1 shellcheck build.
Original file line number Diff line number Diff line change 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 :)
You can’t perform that action at this time.
0 commit comments