Skip to content

Commit

Permalink
modify sed command to work for both Linux and OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
markro49 committed Aug 7, 2024
1 parent 3326b6e commit d2c7f3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions framework/core/Project/JacksonDatabind.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ sub _post_checkout {
my $log = `$cmd`;
my $ret = $?;
if ($ret == 0 && length($log) > 0) {
Utils::exec_cmd("grep -lR ' extends Module\$' $work_dir | xargs sed -i'' -e 's/ extends Module\$/ extends com.fasterxml.jackson.databind.Module/'", "Correct Module ambiguity 1") or die;
Utils::exec_cmd("grep -lR ' extends Module\$' $work_dir | xargs sed -i'.bak' -e 's/ extends Module\$/ extends com.fasterxml.jackson.databind.Module/'", "Correct Module ambiguity 1") or die;
}

$cmd = "grep -lR ' Module ' $work_dir ";
$log = `$cmd`;
$ret = $?;
if ($ret == 0 && length($log) > 0) {
Utils::exec_cmd("grep -lR ' Module ' $work_dir | xargs sed -i'' -e 's/ Module / com.fasterxml.jackson.databind.Module /'", "Correct Module ambiguity 2") or die;
Utils::exec_cmd("grep -lR ' Module ' $work_dir | xargs sed -i'.bak' -e 's/ Module / com.fasterxml.jackson.databind.Module /'", "Correct Module ambiguity 2") or die;
}

my $project_dir = "$PROJECTS_DIR/$self->{pid}";
Expand Down
4 changes: 2 additions & 2 deletions framework/core/Project/Lang.pm
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ sub _post_checkout {
my $log = `$cmd`;
my $ret = $?;
if ($ret == 0 && length($log) > 0) {
Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{src}'/org/apache/commons/lang/enum/' | xargs sed -i'' 's/\\.enum;/\\.oldenum;/'", "Rename enum 1") or die;
Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{src}'/org/apache/commons/lang/enum/' | xargs sed -i'.bak' 's/\\.enum;/\\.oldenum;/'", "Rename enum 1") or die;
}

$cmd = "grep -lR '\.enum;' $work_dir'/'$result->{test}'/org/apache/commons/lang/enum/'";
$log = `$cmd`;
$ret = $?;
if ($ret == 0 && length($log) > 0) {
Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{test}'/org/apache/commons/lang/enum/' | xargs sed -i'' 's/\\.enum;/\\.oldenum;/'", "Rename enum 2") or die;
Utils::exec_cmd("grep -lR '\\.enum;' $work_dir'/'$result->{test}'/org/apache/commons/lang/enum/' | xargs sed -i'.bak' 's/\\.enum;/\\.oldenum;/'", "Rename enum 2") or die;
}

# Fix compilation errors if necessary
Expand Down

0 comments on commit d2c7f3b

Please sign in to comment.