-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
34 lines (28 loc) · 1004 Bytes
/
Program.cs
File metadata and controls
34 lines (28 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.IO;
namespace WebformsToRazorPages {
class Program {
/// <summary>Usage: WebformsToRazorPages.exe "C:\Files" or
/// WebformsToRazorPages.exe "C:\Files\MyFile.aspx"
/// </summary>
static void Main(string[] args) {
if (args.Length < 1) {
throw new ArgumentException("File or folder path is missing.");
}
string path = args[0];
var converter = new Converter();
if (Directory.Exists(path)) {
converter.ConvertProjectInDirectory(path);
}
else if (File.Exists(path)) {
converter.ConvertFile(path);
}
else {
throw new ArgumentException($"'{path}' doesn't exist");
}
foreach (var item in converter.ListConvertedFiles()) {
Console.WriteLine(item);
}
}
}
}