#!/bin/sh -e if [ "$(id -u)" -ne 0 ]; then echo "This utility needs to run as root" exit 1 fi tmp_config="$(mktemp)" cp "$SNAP_BUILDER_CONFIG" "$tmp_config" editor "$tmp_config" while ! "$SNAP/bin/ruby" "$SNAP/bin/github_snap_builder_config_validator" "$tmp_config"; do echo "Press [ENTER] to try again" read _ editor "$tmp_config" done mv "$tmp_config" "$SNAP_BUILDER_CONFIG" snapctl restart github-snap-builder.github-snap-builder