Add ability to get package information

This commit is contained in:
Jeremy Soller 2017-03-27 21:11:43 -06:00
parent 7d426b552c
commit 3536471c47
2 changed files with 16 additions and 0 deletions

11
cook.sh
View File

@ -44,6 +44,17 @@ function op {
unfetch)
rm -rfv build
;;
info)
pushd build > /dev/null
if [ -e Cargo.toml ]
then
package_version="$(cargo config package.version | tr -d '"')"
else
package_version="$(git rev-parse --short HEAD)"
fi
echo "$1_${package_version}"
popd > /dev/null
;;
update)
pushd build > /dev/null
skip="0"

View File

@ -10,6 +10,11 @@ echo "Update rust nightly"
rustup update nightly
echo "Downloading rust source"
rustup component add rust-src
if [ -z "$(which cargo-config)" ]
then
echo "Installing cargo-config"
cargo install -f cargo-config
fi
if [ -z "$(which xargo)" ]
then
echo "Installing xargo"