-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2058 from ipfs/fix/external-exec
run external commands client side
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/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 |