1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 09:34:03 +08:00

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

License: MIT
Signed-off-by: Jonathan Dahan <jonathan@jonathan.is>
This commit is contained in:
Jonathan Dahan
2015-12-16 11:31:55 -05:00
parent fbb607dc66
commit 5ed2322772
3 changed files with 6 additions and 3 deletions

View File

@ -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` 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.

View File

@ -6,9 +6,13 @@ dest_dir="$HOME/Library/LaunchAgents"
IPFS_PATH="${IPFS_PATH:-$HOME/.ipfs}" IPFS_PATH="${IPFS_PATH:-$HOME/.ipfs}"
escaped_ipfs_path=$(echo $IPFS_PATH|sed 's/\//\\\//g') 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" 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" \ "$src_dir/$plist" \
> "$dest_dir/$plist" > "$dest_dir/$plist"

View File

@ -8,7 +8,7 @@
<string>io.ipfs.ipfs-daemon</string> <string>io.ipfs.ipfs-daemon</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>ipfs</string> <string>{{IPFS_BIN}}</string>
<string>daemon</string> <string>daemon</string>
</array> </array>
<key>EnvironmentVariables</key> <key>EnvironmentVariables</key>