From e04306c51ff9c34441ca6b03c04d48a0642c7b7e Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 3 Aug 2024 21:44:34 +0400 Subject: [PATCH] fixed project name, files clean --- Mage.Server.Console/pom.xml | 2 +- RemoveHeaders.java | 71 ----------- Utils/pick-convertor.pl | 86 -------------- Utils/picks/m11.txt | 229 ----------------------------------- Utils/picks/roe.txt | 225 ----------------------------------- Utils/picks/som.txt | 228 ----------------------------------- Utils/picks/wwk.txt | 145 ----------------------- Utils/picks/zen.txt | 230 ------------------------------------ 8 files changed, 1 insertion(+), 1215 deletions(-) delete mode 100644 RemoveHeaders.java delete mode 100755 Utils/pick-convertor.pl delete mode 100644 Utils/picks/m11.txt delete mode 100644 Utils/picks/roe.txt delete mode 100644 Utils/picks/som.txt delete mode 100644 Utils/picks/wwk.txt delete mode 100644 Utils/picks/zen.txt diff --git a/Mage.Server.Console/pom.xml b/Mage.Server.Console/pom.xml index d99a3e07d80..0eaba0b703f 100644 --- a/Mage.Server.Console/pom.xml +++ b/Mage.Server.Console/pom.xml @@ -9,7 +9,7 @@ 1.4.50 - mage.server.console + mage-server-console jar Mage Server Console diff --git a/RemoveHeaders.java b/RemoveHeaders.java deleted file mode 100644 index 0aede8bad13..00000000000 --- a/RemoveHeaders.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Remove the copy right header from all files inside project. -*/ -import java.io.IOException; -import java.io.*; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.regex.Pattern; - -public class RemoveHeaders { - - private static String readEntireFile(String filePath) { - String content = ""; - - try { - content = new String(Files.readAllBytes(Paths.get(filePath))); - } - catch (IOException e) { - e.printStackTrace(); - } - - return content; - } - - private static void saveFileToDisk(String filePath, String content) { - File file = new File(filePath); - Path path = Paths.get(filePath); - - try (FileWriter writer = new FileWriter(file)) { - if (Files.isWritable(path) && !Files.isSymbolicLink(path) && !Files.isHidden(path)) { - writer.write(content); - writer.flush(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - private static String removeMatchingText(String content, Pattern pattern) { - return pattern.matcher(content).replaceAll(""); - } - - public static void recursivelyGetFilesAndRemoveHeaders(String path) { - Pattern copyrightHeader = Pattern.compile("(?i)/\\*(?:\r?\n|\r) ?\\*.*?Copyright[\\S\\s]*?\\*/"); - File currentDirectory = new File(path); - File[] files = currentDirectory.listFiles(); - - if (files == null) { - return; - } - - for (File file : files) { - if (file.isDirectory()) { - recursivelyGetFilesAndRemoveHeaders(file.getAbsolutePath()); - } else { - String filePath = file.getAbsolutePath(); - String fileContents = readEntireFile(filePath); - String updatedContents = removeMatchingText(fileContents, copyrightHeader); - if (fileContents != updatedContents) { - saveFileToDisk(filePath, updatedContents); - } - } - } - } - - public static void main(String args[]) { - String rootPath = System.getProperty("user.dir"); - recursivelyGetFilesAndRemoveHeaders(rootPath); - } -} diff --git a/Utils/pick-convertor.pl b/Utils/pick-convertor.pl deleted file mode 100755 index 7ccc4867cf2..00000000000 --- a/Utils/pick-convertor.pl +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/perl -w - -use Switch; -use strict; - -print "Enter a set name: "; -my $set = ; -chomp $set; -my $lset = lc($set); - -my $source = "$lset.htm"; -my $destination = "$lset.txt"; - -open SRC, "< $source" or die "Can't open source: $!\n"; -open DST, "> $destination" or die "Can't open destination: $!\n"; - -my $state = 0; - -my $name; -my $rate; -my $max; -my $med; -my $min; - - -while () { - my $s = $_; - chomp $s; - if ($state == 0) { - if ($s eq "") { - $state = 1; - next; - } - } elsif ($state == 1) { - if ($s =~//) { - $state = 2; - next; - } - } elsif ($state == 2) { - if ($s =~/>([\w ',]+)<\/a>/) { - $name = $1; - $state = 3; - next; - } - } elsif ($state == 3) { - if ($s =~/