Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ronnie Overby
committed
Apr 13, 2020
1 parent
3deee43
commit 6b1ea72
Showing
5 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<Query Kind="Program"> | ||
<Namespace>System.IO.Compression</Namespace> | ||
</Query> | ||
|
||
void Main() | ||
{ | ||
CreateLPX(); | ||
CreateLPX6(); | ||
} | ||
|
||
void CreateLPX() | ||
{ | ||
var queryFolder = new FileInfo(Util.CurrentQueryPath).DirectoryName; | ||
|
||
var net46Dir = new DirectoryInfo( | ||
Path.Combine(queryFolder, "bin", "Release", "net46")); | ||
|
||
var lpxFile = Path.Combine(queryFolder, "Overby.LINQPad.FileDriver.lpx"); | ||
|
||
File.Delete(lpxFile); | ||
ZipFile.CreateFromDirectory(net46Dir.FullName, lpxFile); | ||
|
||
using var fs = File.Open(lpxFile, FileMode.Open, FileAccess.ReadWrite, FileShare.None); | ||
using var za = new ZipArchive(fs, ZipArchiveMode.Update); | ||
var headerEntry = za.CreateEntry("header.xml"); | ||
using var manstream = headerEntry.Open(); | ||
using var manwriter = new StreamWriter(manstream); | ||
|
||
manwriter.WriteLine( | ||
$@"<?xml version=""1.0"" encoding=""utf-8"" ?> | ||
<DataContextDriver> | ||
<MainAssembly>Overby.LINQPad.FileDriver.dll</MainAssembly> | ||
<SupportUri>http://ronn.io</SupportUri> | ||
</DataContextDriver>"); | ||
} | ||
|
||
void CreateLPX6() | ||
{ | ||
var queryFolder = new FileInfo(Util.CurrentQueryPath).DirectoryName; | ||
|
||
var net46Dir = new DirectoryInfo( | ||
Path.Combine(queryFolder, "bin", "Release", "netcoreapp3.0")); | ||
|
||
var lpxFile = Path.Combine(queryFolder, "Overby.LINQPad.FileDriver.lpx6"); | ||
|
||
File.Delete(lpxFile); | ||
ZipFile.CreateFromDirectory(net46Dir.FullName, lpxFile); | ||
} | ||
|