diff options
author | Itamar <itamar8910@gmail.com> | 2022-01-07 16:27:13 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-12 14:55:19 +0100 |
commit | 3afd17db9db6c3ca93c1e402a8007d9b72bf463b (patch) | |
tree | 722396b5ba7fc53c72d200edeb4527b2eea9b429 /Userland/DevTools | |
parent | 95545648bdf9b03e71cc3a786135c32d37e93e99 (diff) | |
download | serenity-3afd17db9db6c3ca93c1e402a8007d9b72bf463b.zip |
HackStudio: Add Project::project_is_serenity() function
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/HackStudio/Project.cpp | 7 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/Project.h | 1 |
2 files changed, 8 insertions, 0 deletions
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<void(const ProjectFile&)>) const; String to_absolute_path(String const&) const; + bool project_is_serenity() const; private: explicit Project(const String& root_path); |