mirror of
				https://github.com/nsnail/NetAdmin.git
				synced 2025-11-01 03:35:28 +08:00 
			
		
		
		
	build: 📦 rename.csx (#228)
[skip ci] Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
		| @@ -5,8 +5,7 @@ Console.WriteLine("请输入原始名称(NetAdmin):"); | ||||
| var oldName = Console.ReadLine().NullOrEmpty("NetAdmin"); | ||||
| Console.WriteLine("请输入替换名称:"); | ||||
| var newName = Console.ReadLine(); | ||||
| foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*", | ||||
|              SearchOption.AllDirectories)) | ||||
| foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*", SearchOption.AllDirectories).Where(x => !x.Contains(".git"))) | ||||
| { | ||||
|     Console.Write($"{path} --> "); | ||||
|     var newPath = path.Replace(oldName, newName); | ||||
| @@ -16,7 +15,7 @@ foreach (var path in Directory.EnumerateDirectories("../", $"*{oldName}*", | ||||
|  | ||||
|  | ||||
| Console.WriteLine(); | ||||
| foreach (var path in Directory.EnumerateFiles("../", $"*.*", SearchOption.AllDirectories)) | ||||
| foreach (var path in Directory.EnumerateFiles("../", $"*.*", SearchOption.AllDirectories).Where(x => !x.Contains(".git"))) | ||||
| { | ||||
|     File.WriteAllText(path, File.ReadAllText(path).Replace(oldName, newName)); | ||||
|     var newPath = path.Replace(oldName, newName); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 GitHub
						GitHub