Parcourir la source

HackStudio: Remove program name element in Core::command() calls

Core::command() takes care of inserting the program name as the first
element in argv, and so we shouldn't include the program name in the
argument vector we give it.

The Shell's argument parsing logic tolerated the extra argument,
until 83609ad.

This fixes building serenity components in Hack Studio.
Itamar il y a 3 ans
Parent
commit
45788d030a
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      Userland/DevTools/HackStudio/ProjectBuilder.cpp

+ 2 - 2
Userland/DevTools/HackStudio/ProjectBuilder.cpp

@@ -185,7 +185,7 @@ HashMap<String, NonnullOwnPtr<ProjectBuilder::LibraryInfo>> ProjectBuilder::get_
 
 
 void ProjectBuilder::for_each_library_definition(Function<void(String, String)> func)
 void ProjectBuilder::for_each_library_definition(Function<void(String, String)> func)
 {
 {
-    Vector<String> arguments = { "sh", "-c", "find Userland/Libraries -name CMakeLists.txt | xargs grep serenity_lib" };
+    Vector<String> arguments = { "-c", "find Userland/Libraries -name CMakeLists.txt | xargs grep serenity_lib" };
     auto res = Core::command("/bin/sh", arguments, {});
     auto res = Core::command("/bin/sh", arguments, {});
     if (res.is_error()) {
     if (res.is_error()) {
         warnln("{}", res.error());
         warnln("{}", res.error());
@@ -212,7 +212,7 @@ void ProjectBuilder::for_each_library_definition(Function<void(String, String)>
 
 
 void ProjectBuilder::for_each_library_dependencies(Function<void(String, Vector<StringView>)> func)
 void ProjectBuilder::for_each_library_dependencies(Function<void(String, Vector<StringView>)> func)
 {
 {
-    Vector<String> arguments = { "sh", "-c", "find Userland/Libraries -name CMakeLists.txt | xargs grep target_link_libraries" };
+    Vector<String> arguments = { "-c", "find Userland/Libraries -name CMakeLists.txt | xargs grep target_link_libraries" };
     auto res = Core::command("/bin/sh", arguments, {});
     auto res = Core::command("/bin/sh", arguments, {});
     if (res.is_error()) {
     if (res.is_error()) {
         warnln("{}", res.error());
         warnln("{}", res.error());