diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-12-07 10:32:24 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-12-07 10:32:30 -0500 |
commit | 3f515afbb4cb3d22520729453bea5af050c0eb00 (patch) | |
tree | 6aa01feeaaaa0753810fccf62cdc21b3583f4967 | |
parent | 30db03bb623318877bf74422e30766e2516e890e (diff) |
Fix completion build.rs
-rw-r--r-- | build.rs | 16 | ||||
-rw-r--r-- | ci/before_deploy.sh | 4 |
2 files changed, 12 insertions, 8 deletions
@@ -3,6 +3,7 @@ extern crate clap; #[macro_use] extern crate lazy_static; +use std::env; use std::fs; use clap::Shell; @@ -12,12 +13,15 @@ use clap::Shell; mod app; fn main() { - fs::create_dir_all(env!("OUT_DIR")).unwrap(); + let outdir = match env::var_os("OUT_DIR") { + None => return, + Some(outdir) => outdir, + }; + fs::create_dir_all(&outdir).unwrap(); let mut app = app::app_short(); - app.gen_completions("rg", Shell::Bash, env!("OUT_DIR")); - app.gen_completions("rg", Shell::Fish, env!("OUT_DIR")); - // Zsh seems to fail with a panic. - // app.gen_completions("rg", Shell::Zsh, env!("OUT_DIR")); - app.gen_completions("rg", Shell::PowerShell, env!("OUT_DIR")); + app.gen_completions("rg", Shell::Bash, &outdir); + app.gen_completions("rg", Shell::Fish, &outdir); + app.gen_completions("rg", Shell::Zsh, &outdir); + app.gen_completions("rg", Shell::PowerShell, &outdir); } diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index 39202448..27d24916 100644 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -16,11 +16,11 @@ mk_tarball() { local out_dir=$(pwd) local name="${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}" mkdir "$td/$name" + mkdir "$td/$name/complete" cp target/$TARGET/release/rg "$td/$name/" cp {doc/rg.1,README.md,UNLICENSE,COPYING,LICENSE-MIT} "$td/$name/" - cp target/release/build/ripgrep-*/out/rg.* "$td/$name/" - cp target/release/build/ripgrep-*/out/_rg.* "$td/$name/" + cp target/release/build/ripgrep-*/out/{_rg,rg.bash-completion,rg.fish,_rg.ps1} "$td/$name/complete/" pushd $td tar czf "$out_dir/$name.tar.gz" * |