Seamlessly raise permissions during binary mv
* Seamlessly raise permissions during binary mv
Users (interal :) )  have raised confusion statements over the
seamingly failing install succeeding. We drop errors on mv, as we are
going to run sudo mv in that case.
* Check for sudo in install
@@ -60,6 +60,8 @@ main() {
need_cmd tar
need_cmd gzip
need_cmd touch
+ # For instance in Debian sudo can be missing.
+ need_cmd sudo
if ! confirm_license; then
echo "Please accept the license to continue."
@@ -96,7 +98,7 @@ main() {
printf "%s\n" "Will install in: ${_install_dir}"
mkdir -p "${_install_dir}" || true
- mv "$_dfx_file" "${_install_dir}" || sudo mv "$_dfx_file" "${_install_dir}" \
+ mv "$_dfx_file" "${_install_dir}" 2>/dev/null || sudo mv "$_dfx_file" "${_install_dir}" \
|| err "Failed to install the DFINITY Developement Kit: please check your permissions and try again."
log "Installed $_install_dir/dfx"
