From 6f25d73d3df062e7b49df4b2e9dd7cb5aa3a98ca Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Mon, 2 Jun 2025 12:05:43 +0200 Subject: [PATCH] build: remove quotes from rust-version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script would include the quotes and so running `build/build` would result in: $ build/build Running build.. ✓ Radicle key already in ssh-agent Building Radicle 1.2.0.. Creating archive of repository at e9cf91… in build/heartwood-e9cf91….tar.gz.. Building image (radicle-build-1.2.0).. [1/2] STEP 1/17: FROM rust:"1.85"-alpine3.20 AS builder Error: creating build container: parsing reference "rust:\"1.85\"-alpine3.20": invalid reference format Co-authored-by: Lorenz Leutgeb --- build/rust-version | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/rust-version b/build/rust-version index 4f02b123..e500392d 100755 --- a/build/rust-version +++ b/build/rust-version @@ -1,7 +1,11 @@ -#!/bin/sh +#! /usr/bin/env bash +set -euo pipefail -if ! version=$(grep -m 1 -oP "channel\s*=\s*\K(.*)" rust-toolchain.toml); then - echo "fatal: no rust version found via rust-toolchain.toml" >&2 ; exit 1 +if ! version=$(grep -m 1 -oP '^\s*channel\s*=\s*"?\K([\d\.]+)' rust-toolchain.toml) +then + echo "fatal: no rust version found via rust-toolchain.toml" >&2 + exit 1 +else + echo "$version" fi -echo "$version"