Skip to content

Commit

Permalink
buck2: create a .buckroot in init
Browse files Browse the repository at this point in the history
Summary:
Might as well. The user told us they want their project *here*, that seems
like a logical thing to do. Our current "look for the top-most .buckconfig"
approach has always been rather confusing.

Differential Revision: D44992850

fbshipit-source-id: c898e03a8360422fdb4a52ca28a449b38ba58284
  • Loading branch information
krallin authored and facebook-github-bot committed Apr 14, 2023
1 parent 78255a7 commit 54e1eb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/buck2_client/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,14 @@ fn set_up_gitignore(repo_root: &Path) -> anyhow::Result<()> {
Ok(())
}

fn set_up_buckroot(repo_root: &Path) -> anyhow::Result<()> {
fs_util::write(repo_root.join(".buckroot"), "")?;
Ok(())
}

fn set_up_project(repo_root: &Path, git: bool, prelude: bool) -> anyhow::Result<()> {
set_up_buckroot(repo_root)?;

if git {
if !Command::new("git")
.arg("init")
Expand Down

0 comments on commit 54e1eb5

Please sign in to comment.