Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
65785e0a
Commit
65785e0a
authored
Dec 30, 2015
by
Jeromy Johnson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2058 from ipfs/fix/external-exec
run external commands client side
parents
8d48163e
7fe0dadc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
cmd/ipfs/main.go
cmd/ipfs/main.go
+1
-1
test/sharness/t0063-external.sh
test/sharness/t0063-external.sh
+38
-0
No files found.
cmd/ipfs/main.go
View file @
65785e0a
...
...
@@ -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
{
...
...
test/sharness/t0063-external.sh
0 → 100755
View file @
65785e0a
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment