imp: install: trim stack's over-verbose version output
This commit is contained in:
parent
43c9f018dc
commit
c2e6121eb0
@ -638,11 +638,16 @@ pkg_install_pkgs() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get installed Stack version, if any
|
# Get installed Stack version, if any.
|
||||||
stack_version() {
|
stack_version_number() {
|
||||||
stack --version | grep -o 'Version \([[:digit:]]\|\.\)\+'
|
stack --version | grep -o 'Version \([[:digit:]]\|\.\)\+'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get Stack's --version output, trimmed for sanity, if it is installed.
|
||||||
|
stack_version_quiet() {
|
||||||
|
stack --version | grep -E -v '^(Compiled|- |$)'
|
||||||
|
}
|
||||||
|
|
||||||
# Get installed Stack's path
|
# Get installed Stack's path
|
||||||
stack_location() {
|
stack_location() {
|
||||||
command -v stack
|
command -v stack
|
||||||
@ -750,7 +755,7 @@ check_usr_local_bin_on_path() {
|
|||||||
# Check whether Stack is already installed, and print an error if it is.
|
# Check whether Stack is already installed, and print an error if it is.
|
||||||
check_stack_installed() {
|
check_stack_installed() {
|
||||||
if [ "$FORCE_INSTALL_STACK" != "true" ] && has_good_stack ; then
|
if [ "$FORCE_INSTALL_STACK" != "true" ] && has_good_stack ; then
|
||||||
die "Stack $(stack_version) already appears to be installed at:
|
die "Stack $(stack_version_number) already appears to be installed at:
|
||||||
$(stack_location)
|
$(stack_location)
|
||||||
Use 'stack upgrade' or your OS's package manager to upgrade,
|
Use 'stack upgrade' or your OS's package manager to upgrade,
|
||||||
or pass --force-install-stack to this script to install anyway."
|
or pass --force-install-stack to this script to install anyway."
|
||||||
@ -814,7 +819,7 @@ ensure_stack() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "Using stack $(stack --version)"
|
echo "Using stack $(stack_version_quiet)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# get a sed command that supports EREs
|
# get a sed command that supports EREs
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user