-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.ps1
More file actions
32 lines (29 loc) · 769 Bytes
/
deploy.ps1
File metadata and controls
32 lines (29 loc) · 769 Bytes
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
function goBack {
if ($startingDir) {
cd $startingDir
}
}
if ((split-path -Path $pwd -Leaf).ToLower() -ne "shellpower") {
if ($scripts) {
$startingDir=$pwd
cd $scripts
} else {
echo "not in shellpower and cannot find it"
exit 1
}
}
if ($profile) {
if (test-path -Path $profile) {
echo '$profile already exists, not sure what to do (replace or add a source/.).'
goBack
exit 1
}
if (!(test-path -Path .profile)) {
echo 'cannot find .profile to source to $profile'
goBack
exit 1
}
# cat .profile > $profile
New-Item -ItemType HardLink -Path "$profile" -Target "$(join-path $pwd .profile)" > $null && echo 'hard linked $profile'
}
goBack