diff --git a/.travis.yml b/.travis.yml index 25765bb7..f624cdc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,10 @@ before_script: - export RUST_BACKTRACE=full script: - cargo clean -- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo build; fi -- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker run --rm -v $PWD:/volume -w /volume -t clux/muslrust cargo build --release; fi -- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo test; fi -- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo doc --no-deps; fi +- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then cargo build; fi +- if [ "$TRAVIS_EVENT_TYPE" = "push" ]; then docker run --rm -v $PWD:/volume -w /volume -t clux/muslrust cargo build --release; fi +- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then cargo test; fi +- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then cargo doc --no-deps; fi notifications: email: on_success: change @@ -41,7 +41,7 @@ deploy: api_key: secure: jo7upaSy/Suepldw8OAjFhIl0y0xdIrd5W0WS7XMNCtHk3QC+iUSGiqlmZ/uQPp0IW5v8cTKVGyQ5bW66eUj8yLbw1QOwGUKdVF33jdZA1kAwY0baxcZCkbeEbWUiDKMRSJ/kr/AqFKgVJVLBcPhqGmHHmfK+m8RuVSI2ioUrW3hYdLUT35xws4wOdgQiEuKOn6EGUsFaulNj6LJWfl9jYmCUFX55UmMU/VIQiwCEMSCBin739BwHXBDNLwJEgHR9VHceSaBWsazOW6roT9gE6FdUqMGkjiK9vOBgTp9LElfK/4RO30TJ7Nz4EYz3/PoQzNrB3TMMBRtD14I8BnWRGeNKlFwUCXoPWnEeVuyurNQLLb0KiV4+JoxYQ1614pwaIwiz1wMf2yGMswc7VT89KqGGV18saVcQJaPOWSjsNyySWjK0FSMIAyCX5qzixFmvgfPu6Jf9/A2Wd5v6oJypo9i4n4x63UjXXuH/dOeg49V/QlM3py0CsztlUNRypb0NyFOBlYGJerAkKuTSW3Fh3fjte3GS+ze3rzC//ADYowG9R1mJdrpM48busoOzwzytgRHXAAXq0CFlWEw5a/Ly+iES2f3yQbGqx0/ZLIb5oZqlXsv3iEEczhokPiK74Psc/7yG7Mn5+Vjndb1AGcZ6gmNfGFRy4WWcaUFZ/b23VA= after_script: | - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [[ "$TRAVIS_RUST_VERSION" == stable ]]; then + if [ "$TRAVIS_EVENT_TYPE" = "push" ] && [[ "$TRAVIS_RUST_VERSION" == stable ]]; then bash <(curl -sSL https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh) sudo chown -R $USER:$USER target cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID diff --git a/lal.complete.sh b/lal.complete.sh index 6b0eedf6..bce61533 100644 --- a/lal.complete.sh +++ b/lal.complete.sh @@ -7,7 +7,7 @@ _lal() local -r subcommands="build clean configure export fetch help init script run ls query remove rm shell stash save status update upgrade verify - publish env list-components list-dependencies + publish env list-components list-supported-environments list-dependencies list-environments list-configurations propagate" local has_sub @@ -77,7 +77,7 @@ _lal() [[ $in_lal_repo ]] || return 0 local -r env_subs="set reset update help -h --help" if [[ $prev = "set" ]]; then - local -r envs="$(lal list-environments)" + local -r envs="$(lal list-supported-environments)" COMPREPLY=($(compgen -W "$envs" -- "$cur")) else COMPREPLY=($(compgen -W "$env_subs" -- "$cur")) diff --git a/src/list.rs b/src/list.rs index fdac4d0e..cf1534c5 100644 --- a/src/list.rs +++ b/src/list.rs @@ -11,6 +11,14 @@ pub fn buildables(manifest: &Manifest) -> LalResult<()> { Ok(()) } +/// Print the supported environments from the `Manifest` +pub fn supported_environments(manifest: &Manifest) -> LalResult<()> { + for env in &manifest.supportedEnvironments { + println!("{}", env); + } + Ok(()) +} + /// Print the available configurations for a buildable Component pub fn configurations(component: &str, manifest: &Manifest) -> LalResult<()> { let component_settings = match manifest.components.get(component) { diff --git a/src/main.rs b/src/main.rs index f1bbcbf8..7dab4c2b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,6 +64,8 @@ fn handle_environment_agnostic_cmds(args: &ArgMatches, mf: &Manifest, backend: & a.is_present("time")) } else if args.subcommand_matches("list-components").is_some() { lal::list::buildables(mf) + } else if args.subcommand_matches("list-supported-environments").is_some() { + lal::list::supported_environments(mf) } else if let Some(a) = args.subcommand_matches("list-configurations") { lal::list::configurations(a.value_of("component").unwrap(), mf) } else if let Some(a) = args.subcommand_matches("list-dependencies") { @@ -508,6 +510,9 @@ fn main() { .subcommand(SubCommand::with_name("list-components") .setting(AppSettings::Hidden) .about("list components that can be used with lal build")) + .subcommand(SubCommand::with_name("list-supported-environments") + .setting(AppSettings::Hidden) + .about("list supported environments from the manifest")) .subcommand(SubCommand::with_name("list-environments") .setting(AppSettings::Hidden) .about("list environments that can be used with lal build"))