From 5f83a4d110804e3ba33f547ad2f450b3b71cf733 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Thu, 30 May 2024 16:37:07 +0200 Subject: [PATCH] ci: use shebang with better portability in shell scripts, format shell scripts (#21605) --- .github/workflows/build_vinix_locally.sh | 20 +++++++++---------- .../workflows/compile_shaders_in_examples.sh | 8 ++++---- .github/workflows/compile_v_with_vtcc.sh | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_vinix_locally.sh b/.github/workflows/build_vinix_locally.sh index 29e118e605..7222e1419e 100755 --- a/.github/workflows/build_vinix_locally.sh +++ b/.github/workflows/build_vinix_locally.sh @@ -29,28 +29,28 @@ echo "Clone current mlibc" cd $BUILD echo "Patch mlibc for Vinix" -cd mlibc +cd mlibc patch -p3 < ../vinix/patches/mlibc/mlibc.patch cd $BUILD echo "Install mlibc headers" -mkdir mlibc-build -cd mlibc-build -meson --cross-file ../vinix/cross_file.txt --prefix=/ -Dheaders_only=true ../mlibc -ninja -mkdir ../mlibc-headers +mkdir mlibc-build +cd mlibc-build +meson --cross-file ../vinix/cross_file.txt --prefix=/ -Dheaders_only=true ../mlibc +ninja +mkdir ../mlibc-headers DESTDIR=`realpath ../mlibc-headers` ninja install cd $BUILD echo "Attempt to build the Vinix kernel (debug)" -cd vinix/kernel -make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" +cd vinix/kernel +make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" make clean cd $BUILD echo "Attempt to build the Vinix kernel (prod)" -cd vinix/kernel -make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" +cd vinix/kernel +make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" make clean rm -rf $BUILD diff --git a/.github/workflows/compile_shaders_in_examples.sh b/.github/workflows/compile_shaders_in_examples.sh index 50b0df0b23..88225b6093 100755 --- a/.github/workflows/compile_shaders_in_examples.sh +++ b/.github/workflows/compile_shaders_in_examples.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash -for f in examples/sokol/*/ ; do - echo "compiling shaders for $f ..."; - time ./v shader $f; +for f in examples/sokol/*/ ; do + echo "compiling shaders for $f ..."; + time ./v shader $f; echo "done"; done; diff --git a/.github/workflows/compile_v_with_vtcc.sh b/.github/workflows/compile_v_with_vtcc.sh index c75724d2c0..7ca66dffa6 100755 --- a/.github/workflows/compile_v_with_vtcc.sh +++ b/.github/workflows/compile_v_with_vtcc.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex function show() { - printf "\u001b[35m$1\u001b[0m\n" + printf "\u001b[35m$1\u001b[0m\n" } show "Prepare" @@ -23,7 +23,7 @@ show "Generate the C file, for the current V version" ls -la vlang.c show "Compile the C file with vtcc" -export tcclib=thirdparty/tcc/lib/tcc +export tcclib=thirdparty/tcc/lib/tcc export tccinc=$tcclib/include ./vtcc/xx -o v_compiled_with_vtcc vlang.c -L$tcclib -I$tccinc -lc -ldl -pthread -ltcc1 $tcclib/bt-log.o ls -la v_compiled_with_vtcc