Post

🧀 Mac下Emacs手动安装magit

参考 Installing from the Git Repository

其他没什么,就是在安装的时候,如果是Mac系统,有可能会出现以下问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
┌─(~/.emacs.d/site-lisp/plugins/magit)──────────────────────────────────────────────────────────────────────────────────────────────────────────────────(mmmmmcclxxvii@MMMMMCCLXXVII:s000)─┐
└─(19:52:45 on main)──> make                                                                                                                                                 ──(Tue,Jan14)─┘
Compiling magit-section.el
Compiling magit-base.el
Compiling magit-git.el
Compiling magit-mode.el
Compiling magit-process.e
...
Compiling magit-extras.el
Compiling git-rebase.el
Compiling magit-bookmark.el
 Creating magit-autoloads.el
Checking function declarations
Compiling magit-tests.el
Generating magit.texi
Generating magit-section.texi
Generating magit.info
Generating magit-section.info
Generating dir
Generating magit.html
sed: 1: "/<link rel="stylesheet" ...": command a expects \ followed by text
make[1]: *** [magit.html] Error 1
make: *** [docs] Error 2

具体是在处理 HTML 文档中的 CSS 样式链接时 sed 命令执行失败了。这个问题在 macOS 系统上比较常见,因为 macOS 的 sed 命令与 GNU sed 有些不同。

解决方案就是安装GNU sed

1
2
3
4
5
6
#如果你使用 Homebrew
brew install gnu-sed

#然后使用 gsed 替代 sed
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" make

This post is licensed under CC BY 4.0 by the author.