-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.ps1
82 lines (59 loc) · 1.93 KB
/
setup.ps1
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
73
74
75
76
77
78
79
80
81
82
$ErrorActionPreference = "Stop"
$REPO="kidchenko/dotfiles"
$DOTFILES_DIR="~/.$REPO"
function CopyProfile() {
if (!(Test-Path $PROFILE)) {
Write-Host "creating $PROFILE"
New-Item -Path $PROFILE -ItemType File -Force
}
$dest = Split-Path $PROFILE
# Copy-Item ./tools/update.ps1 -Destination ~/.kidchenko/dotfiles/tools/update.ps1 -Force
Copy-Item $DOTFILES_DIR/profile.ps1 -Destination $PROFILE -Force
Copy-Item $DOTFILES_DIR/.login.ps1 -Destination "~/.login.ps1" -Force
Copy-Item $DOTFILES_DIR/.modules.ps1 -Destination "~/.modules.ps1" -Force
Copy-Item $DOTFILES_DIR/.aliases.ps1 -Destination "~/.aliases.ps1" -Force
Copy-Item $DOTFILES_DIR/.gitconfig -Destination ~/.gitconfig -Force
Copy-Item $DOTFILES_DIR/.hyper.win.js -Destination $Env:AppData/Hyper/.hyper.js
}
function EnsureFolders() {
if (!(Test-Path "~/lambda3")) {
Write-Output "~/lambda3 folder does not exist. Creating..."
mkdir "~/lambda3"
Write-Output ""
}
if (!(Test-Path "~/jetabroad")) {
Write-Output "~/jetabroad folder does not exist. Creating..."
mkdir "~/jetabroad"
Write-Output ""
}
if (!(Test-Path "~/thoughtworks")) {
Write-Output "~/thoughtworks folder does not exist. Creating..."
mkdir "~/thoughtworks"
Write-Output ""
}
if (!(Test-Path "~/sevenpeaks")) {
Write-Output "~/sevenpeaks folder does not exist. Creating..."
mkdir "~/sevenpeaks"
Write-Output ""
}
if (!(Test-Path "~/isho")) {
Write-Output "~/isho folder does not exist. Creating..."
mkdir "~/isho"
Write-Output ""
}
if (!(Test-Path "~/kidchenko")) {
Write-Output "~/kidchenko folder does not exist. Creating..."
mkdir "~/kidchenko"
Write-Output ""
}
}
function ReloadProfile {
Write-Output "Reload $PROFILE"
. $PROFILE
}
function Main () {
CopyProfile
EnsureFolders
ReloadProfile
}
Main