提交 5ed23227 作者: Jonathan Dahan

Have install.sh use the full path to ipfs binary if detected

License: MIT
Signed-off-by: 's avatarJonathan Dahan <jonathan@jonathan.is>
上级 fbb607dc
......@@ -2,4 +2,3 @@
A bare-bones launchd agent file for ipfs. To have launchd automatically run the ipfs daemon for you, run `./misc/launchd/install.sh`
Note that the `ipfs` binary must be on the *system* PATH for this to work. Adding a symlink in /usr/bin works well enough for me.
......@@ -6,9 +6,13 @@ dest_dir="$HOME/Library/LaunchAgents"
IPFS_PATH="${IPFS_PATH:-$HOME/.ipfs}"
escaped_ipfs_path=$(echo $IPFS_PATH|sed 's/\//\\\//g')
IPFS_BIN=$(which ipfs || echo ipfs)
escaped_ipfs_bin=$(echo $IPFS_BIN|sed 's/\//\\\//g')
mkdir -p "$dest_dir"
sed 's/{{IPFS_PATH}}/'"$escaped_ipfs_path"'/g' \
sed -e 's/{{IPFS_PATH}}/'"$escaped_ipfs_path"'/g' \
-e 's/{{IPFS_BIN}}/'"$escaped_ipfs_bin"'/g' \
"$src_dir/$plist" \
> "$dest_dir/$plist"
......
......@@ -8,7 +8,7 @@
<string>io.ipfs.ipfs-daemon</string>
<key>ProgramArguments</key>
<array>
<string>ipfs</string>
<string>{{IPFS_BIN}}</string>
<string>daemon</string>
</array>
<key>EnvironmentVariables</key>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论