You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1023 B
54 lines
1023 B
9 years ago
|
import java.util.*;
|
||
|
import java.io.*;
|
||
|
public class makepatch
|
||
|
{
|
||
|
|
||
|
public static void main(String[] args) throws Exception
|
||
|
{
|
||
|
|
||
|
if(args.length == 1)
|
||
|
{
|
||
|
|
||
|
String post = "";
|
||
|
Scanner in = new Scanner(new File(args[0]));
|
||
|
in.nextLine();in.nextLine();
|
||
|
post += in.nextLine().replace("eclipse/Clean/src/main/java","../src-base/minecraft")+"\n";
|
||
|
post += in.nextLine().replace("eclipse/cauldron/src/main/java","../src-work/minecraft")+"\n";
|
||
|
while(in.hasNextLine())
|
||
|
{
|
||
|
|
||
|
String current = in.nextLine();
|
||
|
if(current.contains("No newline at end of file")) continue;
|
||
|
|
||
|
if(current.startsWith("@@"))
|
||
|
{
|
||
|
if(!(current.endsWith("@@") || current.endsWith("@ ")))
|
||
|
{
|
||
|
post += current.substring(0,current.lastIndexOf("@@")+2)+"\n";
|
||
|
post += current.substring(current.lastIndexOf("@@")+2)+"\n";
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
post += current + "\n";
|
||
|
}
|
||
|
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
post += current + "\n";
|
||
|
}
|
||
|
|
||
|
}
|
||
|
in.close();
|
||
|
PrintWriter out = new PrintWriter(new File(args[0]));
|
||
|
out.print(post);
|
||
|
out.close();
|
||
|
|
||
|
}
|
||
|
else
|
||
|
System.out.println("1 patch to fix arg required");
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|