diff --git a/Userland/DevTools/HackStudio/Project.cpp b/Userland/DevTools/HackStudio/Project.cpp index 5e5d2a2919..561684ec36 100644 --- a/Userland/DevTools/HackStudio/Project.cpp +++ b/Userland/DevTools/HackStudio/Project.cpp @@ -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"); +} + } diff --git a/Userland/DevTools/HackStudio/Project.h b/Userland/DevTools/HackStudio/Project.h index 0fc1022d41..573564e02f 100644 --- a/Userland/DevTools/HackStudio/Project.h +++ b/Userland/DevTools/HackStudio/Project.h @@ -30,6 +30,7 @@ public: void for_each_text_file(Function) const; String to_absolute_path(String const&) const; + bool project_is_serenity() const; private: explicit Project(const String& root_path);