From 316b2ac2883098906244322b65a111e6762676c3 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Wed, 16 Apr 2025 09:13:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20fix=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index edd3777..bc425f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,11 +96,23 @@ pub fn build(image: &str, ci: bool) { "set -e".to_string(), "pacman -Syu --noconfirm".to_string(), "pacman -S --noconfirm rsync base-devel".to_string(), - "rsync -a /workdir/ /build/".to_string(), + ]; + + if ci { + let symlink_cmd = format!( + "ln -s {} /build", + std::env::current_dir().unwrap().display() + ); + docker_script.extend([symlink_cmd]); + } else { + docker_script.extend(["rsync -a /workdir/ /build/".to_string()]); + }; + + docker_script.extend([ "useradd -m build".to_string(), "echo 'ALL ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers".to_string(), "chown -R build /build".to_string(), - ]; + ]); if ci { if std::fs::exists("./pacman.conf").unwrap() {