summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-10-08 16:17:11 +0200
committerDavid Lönnhager <david.l@mullvad.net>2020-10-12 11:19:09 +0200
commit25ddb94ebad09a57b75a8b727636b864b74cfb00 (patch)
treeb88b7f91a290caad4a1fb6b8c068e0d16a49fdca
parentc35d13fe25e8e9d6c62db765ef1502b5c0d1957d (diff)
downloadmullvadvpn-25ddb94ebad09a57b75a8b727636b864b74cfb00.tar.xz
mullvadvpn-25ddb94ebad09a57b75a8b727636b864b74cfb00.zip
Only build dependencies and binaries once with build.sh
-rwxr-xr-xbuild.sh12
-rw-r--r--mullvad-cli/src/main.rs5
-rwxr-xr-xupdate-relays.sh3
3 files changed, 10 insertions, 10 deletions
diff --git a/build.sh b/build.sh
index d2fc90c492..6c171998ef 100755
--- a/build.sh
+++ b/build.sh
@@ -134,21 +134,21 @@ fi
################################################################################
./wireguard/build-wireguard-go.sh
+export MULLVAD_ADD_MANIFEST="1"
+
echo "Building Rust code in release mode using $RUSTC_VERSION..."
+cargo +stable build $CARGO_ARGS --release
+
if [[ ("$(uname -s)" == "Darwin") || ("$(uname -s)" == "Linux") ]]; then
- pushd mullvad-cli
mkdir -p "$SCRIPT_DIR/dist-assets/shell-completions"
for sh in bash zsh fish; do
echo "Generating shell completion script for $sh..."
- cargo +stable run $CARGO_ARGS --release --features shell-completions -- \
- shell-completions "$sh" "$SCRIPT_DIR/dist-assets/shell-completions/"
+ cargo +stable run --bin mullvad $CARGO_ARGS --release -- shell-completions "$sh" \
+ "$SCRIPT_DIR/dist-assets/shell-completions/"
done
- popd
fi
-MULLVAD_ADD_MANIFEST="1" cargo +stable build $CARGO_ARGS --release
-
################################################################################
# Other work to prepare the release.
################################################################################
diff --git a/mullvad-cli/src/main.rs b/mullvad-cli/src/main.rs
index 17019c0ab2..7f93e17222 100644
--- a/mullvad-cli/src/main.rs
+++ b/mullvad-cli/src/main.rs
@@ -57,7 +57,6 @@ async fn run() -> Result<()> {
let commands = cmds::get_commands();
let app = build_cli(&commands);
- #[cfg(feature = "shell-completions")]
let app = app.subcommand(
clap::SubCommand::with_name("shell-completions")
.about("Generates completion scripts for your shell")
@@ -71,12 +70,12 @@ async fn run() -> Result<()> {
clap::Arg::with_name("DIR")
.default_value("./")
.help("Output directory where the shell completions are written"),
- ),
+ )
+ .setting(clap::AppSettings::Hidden),
);
let app_matches = app.get_matches();
match app_matches.subcommand() {
- #[cfg(feature = "shell-completions")]
("shell-completions", Some(sub_matches)) => {
let shell = sub_matches
.value_of("SHELL")
diff --git a/update-relays.sh b/update-relays.sh
index 2a2fde13fe..1faa54b991 100755
--- a/update-relays.sh
+++ b/update-relays.sh
@@ -2,4 +2,5 @@
echo "Updating relay list..."
set -e
-cargo run -p mullvad-rpc --bin relay_list > dist-assets/relays.json
+
+cargo +stable run --bin relay_list --release > dist-assets/relays.json