Skip to content

Commit

Permalink
Merge pull request #221 from SierraSoftworks/notheotherben/issue216
Browse files Browse the repository at this point in the history
fix: Move the helpful warning about missing a config file to the gt open command
  • Loading branch information
notheotherben authored Feb 20, 2021
2 parents 1087c84 + 1060369 commit 96bd11d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/commands/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ New applications can be configured either by making changes to your configuratio
#[async_trait]
impl CommandRunnable for OpenCommand {
async fn run(&self, core: &Core, matches: &ArgMatches) -> Result<i32, errors::Error> {
if core.config().get_config_file().is_none() {
warn!("No configuration file has been loaded, continuing with defaults.");
writeln!(core.output(),"Hi! It looks like you haven't set up a Git-Tool config file yet. Try running `git-tool setup` to get started or make sure you've set the GITTOOL_CONFIG environment variable.\n")?;
}

let (app, repo) = match helpers::get_launch_app(core, matches.value_of("app"), matches.value_of("repo")) {
helpers::LaunchTarget::AppAndTarget(app, target) => {
(app, core.resolver().get_best_repo(target)?)
Expand Down
5 changes: 0 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ async fn run<'a>(
}
}

if core.config().get_config_file().is_none() {
warn!("No configuration file has been loaded, continuing with defaults.");
writeln!(core.output(),"Hi! It looks like you haven't set up a Git-Tool config file yet. Try running `git-tool setup` to get started or make sure you've set the GITTOOL_CONFIG environment variable.\n")?;
}

for cmd in commands.iter() {
if let Some(cmd_matches) = matches.subcommand_matches(cmd.name()) {
sentry::add_breadcrumb(sentry::Breadcrumb {
Expand Down

0 comments on commit 96bd11d

Please sign in to comment.