Skip to content

Commit

Permalink
HackStudio: Add Project::project_is_serenity() function
Browse files Browse the repository at this point in the history
  • Loading branch information
itamar8910 authored and awesomekling committed Jan 12, 2022
1 parent 9554564 commit 3afd17d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Userland/DevTools/HackStudio/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,11 @@ String Project::to_absolute_path(String const& path) const
return LexicalPath { String::formatted("{}/{}", m_root_path, path) }.string();
}

bool Project::project_is_serenity() const
{
// FIXME: Improve this heuristic
// Running "Meta/serenity.sh copy-src" installs the serenity repository at this path in the home directory
return m_root_path.ends_with("Source/serenity");
}

}
1 change: 1 addition & 0 deletions Userland/DevTools/HackStudio/Project.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Project {

void for_each_text_file(Function<void(const ProjectFile&)>) const;
String to_absolute_path(String const&) const;
bool project_is_serenity() const;

private:
explicit Project(const String& root_path);
Expand Down

0 comments on commit 3afd17d

Please sign in to comment.