Add support for other paths for ipfs binary
Use `which` to locate `ipfs` rather than guessing.
This commit is contained in:
parent
9ebabf6c42
commit
3512de6ba2
|
@ -1,9 +1,14 @@
|
|||
require('shelljs/global');
|
||||
|
||||
ipfs = function(build_dir) {
|
||||
ipfs_path = "~/go/bin";
|
||||
ipfs_bin = exec('which ipfs').output.split("\n")[0]
|
||||
|
||||
cmd = ipfs_path + "/ipfs add -r " + build_dir;
|
||||
if (ipfs_bin==='ipfs not found'){
|
||||
console.log('=== WARNING: IPFS not in an executable path. Guessing ~/go/bin/ipfs for path')
|
||||
ipfs_bin = "~/go/bin/ipfs";
|
||||
}
|
||||
|
||||
cmd = ipfs_bin + " add -r " + build_dir;
|
||||
|
||||
console.log("=== adding " + cmd + " to ipfs");
|
||||
|
||||
|
|
Loading…
Reference in New Issue