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() {