-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.cake
72 lines (62 loc) · 1.62 KB
/
build.cake
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#load "scripts/utilities.cake"
var target = Argument("target", "Default");
var home = Directory(HomeFolder());
Task("Default")
.IsDependentOn("git")
.IsDependentOn("ssh")
.IsDependentOn("powershell")
.IsDependentOn("zsh")
.IsDependentOn("oh-my-posh")
.Does(() =>
{
});
Task("git")
.Does(() =>
{
dotfile("git/gitconfig", home);
dotfile("git/gitconfig.home", home);
dotfile("git/gitconfig.work", home);
dotfile("git/gitignore.global", home);
dotfile("git/gitconfig.codespaces", home);
var githooks = Directory($"{home}/.githooks");
EnsureDirectoryExists(githooks);
dotfile("git/hooks/commit-msg", githooks, dotting: false, copy: true);
var windowsSshCommand = "C:/Windows/System32/OpenSSH/ssh.exe";
if(IsRunningOnWindows() && EnvironmentVariable("GIT_SSH_COMMAND") != windowsSshCommand) {
Environment.SetEnvironmentVariable("GIT_SSH_COMMAND", windowsSshCommand, EnvironmentVariableTarget.User);
}
});
Task("ssh")
.Does(() =>
{
var app_home = Directory($"{home}/.ssh");
EnsureDirectoryExists(app_home);
dotfile("ssh/config", app_home, dotting: false, copy: true);
});
Task("pwsh")
.WithCriteria(OnPath("pwsh"))
.Does(() =>
{
SymLinkProfile("pwsh", "powershell/profile.ps1");
});
Task("powershellv5")
.WithCriteria(OnPath("powershell"))
.Does(() =>
{
SymLinkProfile("powershell", "powershell/profile.ps1");
});
Task("powershell")
.IsDependentOn("pwsh")
.IsDependentOn("powershellv5");
Task("zsh")
.Does(() =>
{
dotfile("zsh/zshrc", home);
dotfile("zsh/zprofile", home);
});
Task("oh-my-posh")
.Does(() =>
{
dotfile("oh-my-posh/jetersen.omp.json", home);
});
RunTarget(target);