Move main binary to gocryptfs_main

That way the wrapper shell script can be named just "gocryptfs"
This commit is contained in:
Jakob Unterwurzacher 2015-10-05 20:32:10 +02:00
parent 53ecebc71e
commit 552c32c5e9
7 changed files with 35 additions and 17 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
# binary
/gocryptfs
/gocryptfs_main/gocryptfs_main
# temporary files created by the tests
/tmp

8
all.bash Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -eu
cd gocryptfs_main
echo -n "Compiling... "
go build
echo "done."

View File

@ -2,5 +2,7 @@
set -eux
cd gocryptfs_main
go build
go test -bench=.

22
gocryptfs Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Simple wrapper that runs the gocryptfs process in the background
set -eu
dir=$(dirname "$0")
main="$dir/gocryptfs_main/gocryptfs_main"
if [ ! -x $main ]; then
echo "Error: gocryptfs_main executable not found. Run ./all.bash to build it."
exit 1
fi
# This needs user input and cannot run in the background
if [[ $* == *--init* ]]; then
"$main" $*
else
"$main" $* &
sleep 0.1
disown
fi

View File

@ -1,14 +0,0 @@
#!/bin/bash
# Run the gocryptfs process in the background
set -eu
dir=$(dirname "$0")
# This needs user input and cannot run in the background
if [[ $* == *--init* ]]; then
"$dir/gocryptfs" $*
else
"$dir/gocryptfs" $* & disown
fi

View File

@ -13,7 +13,7 @@ import (
"time"
)
const tmpDir = "tmp/"
const tmpDir = "../tmp/"
const plainDir = tmpDir + "plain/"
const cipherDir = tmpDir + "cipher/"
@ -53,7 +53,7 @@ func TestMain(m *testing.M) {
}
//c := exec.Command("./gocryptfs", "--zerokey", "--cpuprofile", "/tmp/gcfs.cpu", cipherDir, plainDir)
c := exec.Command("./gocryptfs", "--zerokey", cipherDir, plainDir)
c := exec.Command("./gocryptfs_main", "--zerokey", cipherDir, plainDir)
c.Stdout = os.Stdout
c.Stderr = os.Stderr
go c.Run()