-
Notifications
You must be signed in to change notification settings - Fork 0
/
Microsoft.PowerShell_profile.ps1
118 lines (100 loc) · 3.03 KB
/
Microsoft.PowerShell_profile.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<#
.SYNOPSIS
Chan Powershell Profile
.DESCRIPTION
Aliases 및 중요 파일경로 관리
.LINK
https://github.com/chanhi2000/chan-alias
.NOTES
Author: chanhi2000 | License: CC0
#>
# 사용자 설정 경로
$env:PATH_ALAIS_HOME = $profile
$env:PATH_ONNARA_ANDROID = "D:\development\android\OnnaraMobileAndroid"
$env:GIT_LOG_FORMAT_DEFAULT = "%Cred%h%Creset %C(yellow)%d%Crest %s %Cgreen(%cr) %C(bold blue) %an %Creset"
Write-Host @"
===================================================
ENVIRONMENT VARIABLES
===================================================
[PATH_ALAIS_HOME]: $profile
[PATH_ONNARA_ANDROID]: $env:PATH_ONNARA_ANDROID
[GIT_LOG_FORMAT_DEFAULT]: $env:GIT_LOG_FORMAT_DEFAULT
===================================================
Aliases
===================================================
[g] - git
[gs] - git status
[gss] - git status --short
[ga] - git add ...
[gc] - git commit ...
[gb] - git branch -vv ...
[gf] - git fetch ...
[glg] - git log ...
[gp] - git push ...
[gpl] - git pull ...
[cdWHA] - change directory to OnnaraMobileAndroid ...
[codeHWAW1] - open VSCode for `onnara01\src\main\assets`
[codeHWAW2] - open VSCode for `onnara02\src\main\assets`
[scrcpyDefault] - run scrcpy with default settings
[scrcpyRec] - run scrcpy showing touches
[killTestbed] - kill testbed agent using adb
[alias] - alias configure
"@
# git
function checkGit() {
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
}
function g() { git }
function gs() { git status }
function gss() { git status --short }
function ga()
{
param([string] $target2Add="*")
git add $target2Add
}
function gc()
{
param([string] $flags)
git commit $flags
}
function gb() { git branch -vv }
function gf()
{
param([string] $targetRepo="origin")
git fetch $targetRepo
}
function glg()
{
git log --abbrev-commit --graph --pretty=format:$env:GIT_LOG_FORMAT_DEFAULT
}
function gp()
{
param(
[string] $targetRepo="origin",
[string] $targetBranch="main"
)
git push $targetRepo $targetBranch
}
function gpl()
{
param(
[string] $targetRepo="origin",
[string] $targetBranch="main"
)
git pull $targetRepo $targetBranch
}
# 개발환경 구성
function cdWHA() { cd $env:PATH_ONNARA_ANDROID }
function codeHWAW1() { code "$env:PATH_ONNARA_ANDROID\onnara01\src\main\assets" }
function codeHWAW2() { code "$env:PATH_ONNARA_ANDROID\onnara02\src\main\assets" }
# ADB 및 안드로이드 관련
function scrcpyDefault() { scrcpy -m 1024 --always-on-top }
function scrcpyRec() { scrcpy -m 1024 --always-on-top --show-touches }
function killTestbed() { adb shell am force-stop kr.go.mobile.testbed.iff }
function alias() { notepad $profile }
# 후처리
$env:PATH += ";$env:UserProfile\scoop\apps\oh-my-posh\current\bin"
oh-my-posh --init --shell pwsh --config "$env:UserProfile\scoop\apps\oh-my-posh\current\themes\agnoster.omp.json" | Invoke-Expression
Import-Module Terminal-Icons
# neofetch