diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-06-16 17:02:06 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-06-16 17:02:52 +0100 |
commit | d28cf3af108c45101cf254a56334426614521091 (patch) | |
tree | 11b092ea0f104fc579ccec73e19a0c7412b785be /manage-baserock | |
parent | 352b10b0dcebc1156bcb9b5f79b525be013d87cd (diff) | |
download | baserock-chroot-d28cf3af108c45101cf254a56334426614521091.tar.gz |
Give helpful error when URL doesn't exist
It's slightly confusing that this script doesn't parse file:// URLs,
but this is an improvement.
Previously the error given was:
ln: failed to create symbolic link ‘/opt/baserock/chroots/tmp.P46u6ZxYQC/tarball’ -> ‘’: No such file or directory
Sorry, could not link foo into place
Diffstat (limited to 'manage-baserock')
-rwxr-xr-x | manage-baserock | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/manage-baserock b/manage-baserock index 0ac0aee..b3a8f52 100755 --- a/manage-baserock +++ b/manage-baserock @@ -73,6 +73,10 @@ case "${ACTION}" in trap cleanup 0 if test "x${URL}" = "x${URL##http://}" -a "x${URL}" = "x${URL##https://}"; then + if ! test -e ${URL}; then + echo "${URL} is neither a HTTP/HTTPS url nor a path to a local file"; + exit 1; + fi if ! ln -s "$(readlink -e "${URL}")" "${TEMP_BASE}/tarball"; then echo "Sorry, could not link ${URL} into place"; exit 1; |