-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
142 lines (122 loc) · 3.19 KB
/
Taskfile.yml
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
version: "3"
#
# global vars: https://taskfile.dev/#/usage?id=variables
#
vars:
VAR1: "some-var"
# global env:
env:
ENV1: testing
################################################################################################
tasks:
default:
cmds:
- echo "hello world"
install:
aliases: [ "i" ]
cmds:
- bun install
add:
aliases: [ "a" ]
cmds:
- bun add -D vitepress
- bun add -D open-cli
- bun add -D @lunariajs/core
- bun add -D markdown-it-mathjax3
- bun add -D naive-ui
# - bun add -D unocss
# - bun add -D @unocss/postcss
- bun add -D daisyui@latest
- bun add -D tailwindcss
- bun add -D postcss
- bun add -D prettier
- bun add -D autoprefixer
- bun add -D @iconify/vue # icon
fix:quasar:
aliases: [ "fq" ]
cmds:
- bun add quasar @quasar/extras
- bun add --dev @quasar/vite-plugin sass@^1.33.0
- bun add --dev unplugin-vue-components
- bun add --dev unplugin-auto-import
- bun add --dev vue
- bun add --dev vue-i18n
- bun add --dev vue-router
check:
cmds:
- quasar -h
- quasar info
remove:
aliases: [ "rm" ]
cmds:
- bun remove unocss
- bun remove @unocss/postcss
run:
aliases: [ "r" ]
cmds:
- bun run dev
build:
aliases: [ "b" ]
cmds:
- bun run build
- open ./.vitepress/dist/
preview:
aliases: [ "p" ]
cmds:
- bun run preview
deploy:
aliases: [ "dp", "up", "upload" ]
cmds:
- echo "deploy to {{ .GIT_REPO }} gh-pages"
# TODO X: 删除 .git 文件
- rm -rf .git/
- git init
# TODO X: 如果是发布到自定义域名
- echo '{{ .DOMAIN }}' > CNAME
- git add -A
- git commit -m 'deploy'
# - |
# cd ..;
# repo_url=`git remote -v | grep push | awk -F ":" '{print $2}' | awk -F ".git " '{print "[email protected]:"$1".git"}'`;
# echo "git remote add $repo_url";
# cd .dist/;
# git remote add origin $repo_url
- git remote add origin {{.GIT_REPO}}
- git branch -M {{.BRANCH}}
- git push -f origin {{.BRANCH}}
dir: .vitepress/dist/
vars:
GIT_REPO: [email protected]:better-try/better-try.github.io.git
BRANCH: gh-pages
DOMAIN: "trybetter.app"
ignore_error: true
quick:
aliases: [ "q" ]
cmds:
- task: build
- task: deploy
- task: open
clean:
aliases: [ "cl" ]
cmds:
- rm -rf cache/
- rm -rf dist/
dir: .vitepress/
echo:
cmds:
- echo "deploy to {{ .GIT_REPO }} gh-pages"
vars:
GIT_REPO: [email protected]:better-ts/vitepress-template.git
fmt:
aliases: [ "fmt-repo-url" ]
cmds:
- |
repo_url=`git remote -v | grep push | awk -F ":" '{print $2}' | awk -F ".git " '{print "[email protected]:"$1".git"}'`;
echo $repo_url;
open:
aliases: [ "open-repo-url" ]
cmds:
- echo $(git remote -v | grep push | awk -F ":" '{print $2}')
- |
repo_url=`git remote -v | grep push | awk -F ":" '{print $2}' | awk -F ".git " '{print "https://github.com/"$1}'`;
open $repo_url;