Commit 65785e0a authored by Jeromy Johnson's avatar Jeromy Johnson

Merge pull request #2058 from ipfs/fix/external-exec

run external commands client side
parents 8d48163e 7fe0dadc
......@@ -321,7 +321,7 @@ func callCommand(ctx context.Context, req cmds.Request, root *cmds.Command, cmd
}
}
if client != nil {
if client != nil && !cmd.External {
log.Debug("Executing command via API")
res, err = client.Send(req)
if err != nil {
......
#!/bin/sh
#
# Copyright (c) 2015 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="test external command functionality"
. lib/test-lib.sh
# set here so daemon launches with it
PATH=`pwd`/bin:$PATH
test_init_ipfs
test_launch_ipfs_daemon
test_expect_success "create fake ipfs-update bin" '
mkdir bin &&
echo "#!/bin/sh" > bin/ipfs-update &&
echo "pwd" >> bin/ipfs-update &&
chmod +x bin/ipfs-update
'
test_expect_success "external command runs from current user directory" '
mkdir just_for_test &&
(cd just_for_test && ipfs update) > actual
'
test_expect_success "output looks good" '
echo `pwd`/just_for_test > exp &&
test_cmp exp actual
'
test_kill_ipfs_daemon
test_done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment