cheat: Fix install (#4043)

This commit is contained in:
Cherno Chiu 2022-10-20 16:11:32 +08:00 committed by GitHub
parent fc2f4bd029
commit 4f755d794e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,8 +14,7 @@
"$file = 'conf.yml'",
"if (!(Test-Path \"$persist_dir\\$file\")) {",
" Write-Host 'File' $file 'does not exists. Creating.' -f Yellow",
" $CONT = $(& \"$dir\\cheat\" --init) -replace 'editor: vim', 'editor: notepad' -replace 'cheatsheets/', \"$persist_dir/cheatsheets/\"",
" Set-Content \"$dir\\$file\" ($CONT -replace '\\\\', '/') -Encoding ASCII",
" New-Item -ItemType File -Force -Path \"$dir\\$file\" | Out-Null",
"}",
"if (!(Test-Path \"$persist_dir\\cheatsheets\")) {",
" Write-Host 'Adding community cheatsheets...' -f Yellow",
@ -23,6 +22,11 @@
" git clone -q 'https://github.com/cheat/cheatsheets.git' \"$persist_dir\\cheatsheets\\community\"",
"}"
],
"post_install": [
"$file = 'conf.yml'",
"$CONT = $(& \"$dir\\cheat\" --init) -replace 'editor: EDITOR_PATH', 'editor: notepad' -replace 'pager: PAGER_PATH', 'pager: more'",
"Set-Content \"$dir\\$file\" $CONT -Encoding ASCII"
],
"env_set": {
"CHEAT_CONFIG_PATH": "$dir\\conf.yml"
},