-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathrun_windows_terminal.bat.tmpl
40 lines (33 loc) · 1.13 KB
/
run_windows_terminal.bat.tmpl
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
{{ if eq .chezmoi.os "windows" -}}
:: -*-mode:bat-*- vim:ft=bat
:: ~/.local/share/chezmoi/run_windows_terminal.bat
:: ============================================================================
:: Runs after `chezmoi apply` to relocate Windows Terminal's configuration file.
::
:: This batch file copies the configuration file to its proper destination on
:: Windows. Chezmoi will skip this script on other operating systems.
:: See https://www.chezmoi.io/docs/how-to/
::
:: {{- /* This file supports Go's text/template language. */}}
@echo off
set SRCFILE=%USERPROFILE%\.config\windows_terminal\profiles.json
set DESTFILE=%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles.json
:: Skip if application has not been installed.
FOR %%A in (%DESTFILE%) do (
IF NOT EXIST %%~pA (
exit 0
)
)
:: Skip if destination is a symbolic link.
dir %DESTFILE% | find "<SYMLINK>" > nul
IF %errorlevel% == 0 (
exit 0
)
:: Skip if configuration files are identical.
fc /b %SRCFILE% %DESTFILE% > nul
IF %errorlevel% == 0 (
exit 0
)
:: Copy source file to destination.
xcopy /fvy %SRCFILE% %DESTFILE%*
{{- end }}