Return on failure

This commit is contained in:
Mo 2023-08-13 14:48:27 +02:00
parent b111378a4d
commit d8a3f5f4de
2 changed files with 6 additions and 6 deletions

View file

@ -2,17 +2,17 @@
if test -z $argv[1]
echo "A container number is required as the first argument!"
exit 1
return 1
end
set -l container_name ttyd$argv[1]
set -l container_volumes_dir ~/volumes/$container_name
set -l container_home_dir $container_volumes_dir/home
mkdir -p $container_volumes_dir
mkdir -p $container_volumes_dir; or return 1
if not test -d $container_home_dir
cp -r ~/fedora_home_clone $container_home_dir
cp -r ~/fedora_home_clone $container_home_dir; or return 1
end
podman-default-create \

View file

@ -6,10 +6,10 @@ if test -z "$STUDENT_USER_PASSWORD" || test -z "$TTYD_USER" || test -z "$TTYD_PA
end
# Clean up
podman rmi -i ttyd
podman rmi -i ttyd; or return 1
buildah rm builder &>/dev/null
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest
buildah from --pull --name builder registry.fedoraproject.org/fedora:latest; or return 1
# Remove the flag that prevents installing docs
buildah run builder -- sed -i /nodocs/d /etc/dnf/dnf.conf
@ -53,6 +53,6 @@ buildah unshare -- sh (status dirname)/buildah_unshare.sh
buildah config \
--workingdir /home/student \
--cmd "bash -c 'chown -R student:student /home/student && runuser -u student -- ttyd -c $TTYD_USER:$TTYD_PASSWORD bash'" \
builder
builder; or return 1
buildah commit --rm builder ttyd