Move main binary to gocryptfs_main
That way the wrapper shell script can be named just "gocryptfs"
This commit is contained in:
parent
53ecebc71e
commit
552c32c5e9
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
# binary
|
||||
/gocryptfs
|
||||
/gocryptfs_main/gocryptfs_main
|
||||
|
||||
# temporary files created by the tests
|
||||
/tmp
|
||||
|
8
all.bash
Executable file
8
all.bash
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
cd gocryptfs_main
|
||||
echo -n "Compiling... "
|
||||
go build
|
||||
echo "done."
|
@ -2,5 +2,7 @@
|
||||
|
||||
set -eux
|
||||
|
||||
cd gocryptfs_main
|
||||
|
||||
go build
|
||||
go test -bench=.
|
||||
|
22
gocryptfs
Executable file
22
gocryptfs
Executable 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
|
14
gocryptfs.sh
14
gocryptfs.sh
@ -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
|
@ -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()
|
Loading…
Reference in New Issue
Block a user