fix: report errors if yay is needed but it is not installed

This commit is contained in:
Amin Yahyaabadi 2023-07-20 03:12:39 -07:00
parent 623beb0a25
commit 69ae3d5dd5
16 changed files with 15 additions and 59 deletions

@ -1 +1 @@
Subproject commit b10f2e841835b93cee67dff1eb70d6fa5c0ac0cd
Subproject commit c30589196b2c59a3055dfc7c24244b4a1f48b081

View File

@ -20,8 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--cppcheck true \
--gcovr true \
--doxygen true \
--ccache true \
--powershell true && \
--ccache true && \
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \

View File

@ -44,11 +44,3 @@ FROM archlinux:base as runner
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]
#### Cross Building (example)
FROM setup-cpp-arch-mingw AS builder-mingw
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build_cross_mingw'

View File

@ -41,11 +41,3 @@ FROM fedora:38 as runner
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]
#### Cross Building (example)
FROM setup-cpp-fedora-mingw AS builder-mingw
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build_cross_mingw'

View File

@ -47,11 +47,3 @@ FROM ubuntu:22.04 as runner
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]
#### Cross Building (example)
FROM setup-cpp-ubuntu-mingw AS builder-mingw
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build_cross_mingw'

View File

@ -14,11 +14,3 @@ FROM archlinux:base as runner
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]
#### Cross Building (example)
FROM setup-cpp-arch-mingw AS builder-mingw
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build_cross_mingw'

View File

@ -14,11 +14,3 @@ FROM fedora:38 as runner
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]
#### Cross Building (example)
FROM setup-cpp-fedora-mingw AS builder-mingw
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build_cross_mingw'

View File

@ -19,8 +19,7 @@ RUN pacman -Syuu --noconfirm && \
--cppcheck true \
--gcovr true \
--doxygen true \
--ccache true \
--powershell true && \
--ccache true && \
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \

View File

@ -14,11 +14,3 @@ FROM ubuntu:22.04 as runner
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
WORKDIR /home/app/
ENTRYPOINT ["./my_exe"]
#### Cross Building (example)
FROM setup-cpp-ubuntu-mingw AS builder-mingw
COPY ./dev/cpp_vcpkg_project /home/app
WORKDIR /home/app
RUN bash -c 'source ~/.cpprc \
&& task build_cross_mingw'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@ import { InstallationInfo } from "./setupBin"
import { execRootSync } from "admina"
import { info, warning } from "ci-log"
import { execa } from "execa"
import which from "which"
/* eslint-disable require-atomic-updates */
let didUpdate: boolean = false
@ -13,6 +14,11 @@ export async function setupPacmanPack(name: string, version?: string, aur?: stri
const pacman = "pacman"
if (aur === "yay" && which.sync("yay", { nothrow: true }) === null) {
// TODO: install yay automatically
throw new Error(`yay is needed for ${name}, but it is not installed, please install it manually first`)
}
// yay can't run as root, so skip update
if (!didUpdate && aur !== "yay") {
execRootSync(pacman, ["-Sy", "--noconfirm"])