private static void SetUpGitFiles() { EnvironmentVariables ev = EnvironmentVariables.Instance; string precommitPath = Path.Combine(ev["userpath"], ev["precommitPath"]); string gitAttributesPath = Path.Combine(ev["userpath"], ev["gitAttributesPath"]); string gitIgnorePath = Path.Combine(ev["userpath"], ev["gitIgnorePath"]); string emptyDirectoryRemoverPath = Path.Combine(ev["userpath"], ev["emptyDirectoryRemoverPath"]); using (var wc = new WebClient()) { WebLoader.SaveText(wc, ev["precommitHook"], precommitPath); Dialogue($"Precommit Hook has been placed @ {precommitPath}"); WebLoader.SaveText(wc, ev["gitAttributes"], gitAttributesPath); Dialogue($"Git Attributes have been placed @ {gitAttributesPath}"); WebLoader.SaveText(wc, ev["gitIgnore"], gitIgnorePath); Dialogue($"Git Ignore has been been placed @ {gitIgnorePath}"); if (!DirectoryManipulator.Find(Path.Combine(ev["userpath"], ev["assetsFolder"]))) { Dialogue("I was unable to locate an assets folder, I have created one for now."); DirectoryManipulator.CreateNew(Path.GetDirectoryName(emptyDirectoryRemoverPath)); } WebLoader.ScrapeText(wc, ev["emptyDirectoryRemover"], emptyDirectoryRemoverPath); Dialogue($"EmptyDirectoryRemover has been placed @ {emptyDirectoryRemoverPath}"); } }
public static string SaveKeyPair(SshKeyPair keyPair) { DirectoryManipulator.CreateNew(EnvironmentVariables.Instance["defaultSSHDirectory"]); FileManipulator.SaveFile(EnvironmentVariables.Instance["publicKeyDefaultFilePath"], keyPair.PublicKey); FileManipulator.SaveFile(EnvironmentVariables.Instance["privateKeyDefaultFilePath"], keyPair.PrivateKey); return(EnvironmentVariables.Instance["publicKeyDefaultFilePath"]); }