Skip to content

Commit

Permalink
Rename the zips for weekly releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ogham committed Oct 8, 2017
1 parent c7497f3 commit 2e2598c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ Vagrant.configure(2) do |config|
echo -e "#!/bin/sh\nbuild-exa && test-exa && run-xtests" > /usr/bin/compile-exa
ln -sf /usr/bin/compile-exa /usr/bin/c
echo -e "#!/bin/sh\nbash /vagrant/devtools/dev-package-for-linux.sh" > /usr/bin/package-exa
echo -e "#!/bin/sh\ncat /etc/motd" > /usr/bin/halp
echo -e "#!/bin/sh\nbash /vagrant/devtools/dev-package-for-linux.sh \\$@" > /usr/bin/package-exa
echo -e "#!/bin/sh\ncat /etc/motd" > /usr/bin/halp
chmod +x /usr/bin/{exa,rexa,b,t,x,c,build-exa,test-exa,run-xtests,compile-exa,package-exa,halp}
EOF
Expand Down
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ fn main() {
}

fn is_development_version() -> bool {
env::var("PROFILE").unwrap() == "debug"
// Both weekly releases and actual releases are --release releases,
// but actual releases will have a proper version number
cargo_version().ends_with("-pre") || env::var("PROFILE").unwrap() == "debug"
}

fn cargo_version() -> String {
Expand Down
12 changes: 11 additions & 1 deletion devtools/dev-package-for-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ eval exa_$(grep version $toml_file | head -n 1 | sed "s/ //g")
if [ -z "$exa_version" ]; then
echo "Failed to parse version number! Can't build exa!"
exit 1
fi

# Weekly builds have a bit more information in their version number (see build.rs).
if [[ "$1" == "--weekly" ]]; then
git_hash=`GIT_DIR=/vagrant/.git git rev-parse --short --verify HEAD`
date=`date +"%Y-%m-%d"`
echo "Building exa weekly v$exa_version, date $date, Git hash $git_hash"
else
echo "Building exa v$exa_version"
fi
Expand All @@ -50,7 +57,10 @@ strip -v "$exa_linux_binary"
# the binaries can have consistent names, and it’s still possible to tell
# different *downloads* apart.
echo -e "\n\033[4mZipping binary...\033[0m"
exa_linux_zip="/vagrant/exa-linux-x86_64-${exa_version}.zip"
if [[ "$1" == "--weekly" ]]
then exa_linux_zip="/vagrant/exa-linux-x86_64-${exa_version}-${date}-${git_hash}.zip"
else exa_linux_zip="/vagrant/exa-linux-x86_64-${exa_version}.zip"
fi
rm -vf "$exa_linux_zip"
zip -j "$exa_linux_zip" "$exa_linux_binary"

Expand Down

0 comments on commit 2e2598c

Please sign in to comment.