-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.diff
More file actions
69 lines (67 loc) · 1.85 KB
/
patch.diff
File metadata and controls
69 lines (67 loc) · 1.85 KB
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
diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl
index 429b7ec..3935680 100644
--- a/.chezmoi.toml.tmpl
+++ b/.chezmoi.toml.tmpl
@@ -5,3 +5,6 @@
[data]
workProfile = {{ $workProfile }}
+
+[scriptEnv]
+ WORK_PROFILE = "{{ $workProfile }}"
\ No newline at end of file
diff --git a/.chezmoiignore b/.chezmoiignore
index ffd9716..e11e7ea 100644
--- a/.chezmoiignore
+++ b/.chezmoiignore
@@ -15,3 +15,10 @@ Makefile
.hammerspoon/
.config/karabiner/
{{- end }}
+
+{{- if eq .workProfile true }}
+# work profile overwrite these file
+.gitconfig
+Brewfile
+.zshrc.d/work.zsh
+{{- end}}
diff --git a/dot_zshrc.d/work.zsh.tmpl b/dot_zshrc.d/work.zsh.tmpl
deleted file mode 100644
index 1d5f87a..0000000
--- a/dot_zshrc.d/work.zsh.tmpl
+++ /dev/null
@@ -1,20 +0,0 @@
-# Work-specific configuration
-# Set WORK_PROFILE=true environment variable to enable work-specific settings
-
-{{- if .workProfile }}
-
-# Add your work-specific aliases, functions, and environment variables here
-
-# Example:
-# export WORK_PROJECT_DIR=~/work
-# alias work-ssh='ssh user@work-server'
-
-# Work-specific git config
-# You can override git config for work directories by adding to ~/.gitconfig_work:
-# [user]
-# name = Your Work Name
-# email = your.work.email@company.com
-{{- else }}
-
-# Work profile is disabled. Set WORK_PROFILE=true to enable.
-{{- end }}
diff --git a/run_onchange_after_brewfile.sh.tmpl b/run_onchange_after_brewfile.sh.tmpl
index e7ca371..fa4f603 100644
--- a/run_onchange_after_brewfile.sh.tmpl
+++ b/run_onchange_after_brewfile.sh.tmpl
@@ -2,6 +2,11 @@
# Run brew bundle when Brewfile changes
# Hash: {{ include "Brewfile.tmpl" | sha256sum }}
+if [ "${WORK_PROFILE}" = "true" ]; then
+echo "🏢 Work profile detected, skipping brew bundle."
+exit 0
+fi
+
if command -v brew &> /dev/null; then
if [ -f ~/Brewfile ]; then
echo "Running brew bundle..."