feat(git-provider): add Sqlite to PowershellModule
- add CopyLocalLockFileAssemblies to PowershellModule.csproj - add postbuild script to copy Sqlite files and remove unneeded files in debug output - add sqlite-net-pcl 1.11.285
This commit is contained in:
parent
830ae2c560
commit
6193d30029
5 changed files with 73 additions and 32 deletions
39
src/PowershellModule/Git/NewGitRepoCommand.cs
Normal file
39
src/PowershellModule/Git/NewGitRepoCommand.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Management.Automation;
|
||||
using SQLite;
|
||||
|
||||
namespace PowershellModule.Git;
|
||||
|
||||
[Cmdlet(VerbsCommon.New, Noun)]
|
||||
public class NewGitRepoCommand : PSCmdlet
|
||||
{
|
||||
private const string Noun = "GitRepo";
|
||||
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
Position = 0,
|
||||
ValueFromPipeline = true,
|
||||
HelpMessage = "Reference name for the repo")]
|
||||
public string Name { get; set; }
|
||||
|
||||
protected override void BeginProcessing()
|
||||
{
|
||||
using var conn = new SQLiteConnection("./test.db");
|
||||
|
||||
var pwd = this.SessionState.Path.CurrentLocation.Path;
|
||||
WriteObject("Checking if current directory is a git repository...");
|
||||
var ps = new ProcessStartInfo( //$"git -C \"{pwd}\" rev-parse --show-toplevel")
|
||||
"git", ["rev-parse", "--show-toplevel"])
|
||||
{
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
WorkingDirectory = pwd
|
||||
};
|
||||
var a = Process.Start(ps);
|
||||
Console.WriteLine(a.StandardOutput.ReadToEnd());
|
||||
Console.WriteLine(a.StandardError.ReadToEnd());
|
||||
|
||||
base.BeginProcessing();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue